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 |
tanvirasad
Starting Member
10 Posts |
Posted - 2006-11-03 : 04:39:28
|
I have table where I have stored the SQL Statement when I fire the query on that record it shoul run the statement which is stored in that column.e.gINSERT INTO MyTable ('Select MyCol From MySecondTable')When I Run "Select * From MyTable"It Should Run"Select MyCol From MySecondTable"Tanvir Asad |
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2006-11-03 : 05:51:34
|
Something like this maybe:DECLARE @SQL nvarchar(4000)SET @SQL = (SELECT SQL FROM MyTable WHERE ID = x)EXEC sp_executesql @SQL --Lumbago"Real programmers don't document, if it was hard to write it should be hard to understand" |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-11-03 : 05:54:42
|
Missed the single quote around the stringSET @SQL = '(SELECT SQL FROM MyTable WHERE ID = x)' KH |
 |
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
|
|
|
|