--DROP TABLE #T
CREATE TABLE
#T (ID VARCHAR(10) ,FYJE VARCHAR(10) ,TDBH
VARCHAR(10),DATE1 DATETIME)
declare @tbName varchar(10),@Name varchar(10),@Sex varchar(10),@AddID varchar(10),@SQL VARCHAR(100),@DATE VARCHAR(20)
SET @tbName='#T'
SET @AddID='1'
SET @Name='谢颖'
SET @Sex='女'
SET
@DATE='2007-10-11'
exec('INSERT INTO '+@tbName+' VALUES (CONVERT (INT,'''+@AddID+'''),'''+@Name+''','''+@Sex+''',CONVERT (DATETIME,''' + @DATE +'''))')
SELECT * FROM #T
试一下!
[[italic] 本帖最后由 XieLi 于 2007-12-5 11:32 编辑 [/italic]]