Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
declare @insertSQL nvarchar(max)declare @day intset @day = day(getdate())set @insertSQL = 'insert into test.dbo.testnew2(name,date,day,test1,test2,test3) values (''@name'',''@Date'',@day,@test1,@test2,@test3)'I am writing in sp. but it kept saying invalid colum. but the columns are same as structure!What am missing??
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2009-01-04 : 03:36:46
whats the need of dynamic sql here? wont you require only this?
insert into test.dbo.testnew2(name,date,day,test1,test2,test3) values (@name,@Date,@day,@test1,@test2,@test3)
thiyagu_rind
Starting Member
46 Posts
Posted - 2009-01-23 : 00:21:53
hi,Yeah, there is no need for the Dynamic Query and check the columns names are correctly matching with the table.RegardsThiyagarajanwww.sqlhunt.blogspot.com
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2009-01-23 : 00:58:47
quote:Originally posted by thiyagu_rind hi,Yeah, there is no need for the Dynamic Query and check the columns names are correctly matching with the table.RegardsThiyagarajanwww.sqlhunt.blogspot.com