| Author: sathiyasivam 25 Sep 2007 | Member Level: Diamond | Rating: Points: 2 |
Hi victoria,
Dynamic SQL means the values are assign to it at run time.
SET @SQL= 'SELECT * INTO ' + @VAR + ' FROM server1.dbname.DBO.' + @VAR + ' WHERE Dim_ID IN (SELECT Dim_ID FROM dbo.table2)' PRINT @SQL EXECUTE SP_EXECUTESQL @SQL
In the above @var is dynamic value ,here im creating the sql at runtime and it is dynamic.Any more mail me
Regards Sathiya
|
| Author: http://venkattechnicalblog.blogspot.com/ 25 Sep 2007 | Member Level: Diamond | Rating: Points: 2 |
Please check this link for dynamic query, I think you have asked only for link, if you need more about dynamic sql just send me a message regarding this,
http://www.sqlteam.com/article/introduction-to-dynamic-sql-part-1
Regards, Venkatesan Prabu. J
|