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.
| Author |
Topic |
|
Sun Foster
Aged Yak Warrior
515 Posts |
Posted - 2009-11-04 : 14:22:00
|
| I want to use sp_executesql in insert statement but got an error:declare @sql nvarchar(2000)set @sql = insert into tOrder (f1, f2...f20)select f1, f2, ... f20 from tOrderOldexec sp_executesql @sqlWhat is wrong? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Pradip
Starting Member
32 Posts |
Posted - 2009-11-05 : 03:27:11
|
| declare @sql nvarchar(2000)set @sql ='insert into t1(a) select a from t2'exec sp_executesql @sql it works fine, please check your code.pradipjain |
 |
|
|
|
|
|