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 |
|
sql777
Constraint Violating Yak Guru
314 Posts |
Posted - 2008-02-21 : 17:55:58
|
| Hi,Is it possible for me to load my CTE with a query that I pass in as a parameter to the sproc? I'm trying it and it doesn't seem to work.I'm doing:CREATE PROCEDURE blah@sql NTEXTASWITH CTE(...) AS( EXEC sp_executesql @sql)select ...What's wrong? |
|
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2008-02-21 : 20:10:17
|
| Not that I condone dynamic SQL, but why not just put the CTE stuff into the dynamic SQL? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-02-22 : 01:35:18
|
| Why do you want to pass entire sql as parameter?Make sure you read this fullywww.sommarskog.se/dynamic_sql.htmlMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|