Posted by SQL on 05/16/06 21:34
I see, you need triple quotes to store the table name This should do it set @SQL = 'INSERT INTO [zzTable_Status] SELECT '''+ @tbl +''' , count(distinct station__no), count(station__no) FROM [bronze_views].'+@tbl+'' Denis the SQL Menace http://sqlservercode.blogspot.com/
[Reply to this message]
Copyright © 2005-2006 Powered by Custom PHP Programming