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.
msvdm Starting Member
17 Posts
tkizer Almighty SQL Goddess
38200 Posts
russell Pyro-ma-ni-yak
5072 Posts
Declare @n intDeclare @table sysnameDeclare @col sysnameSet @table = 'YourTable'Set @n = 3SELECT @col = name FROM sys.columns WHERE object_id = object_id(@table)IF @col IS NOT NULLBEGIN EXEC ('SELECT [' + @col + '] FROM [' + @table + '];')END
SQLTeam.com Articles via RSS
SQLTeam.com Weblog via RSS
- Advertisement -
Articles
Forums
Blogs
Contact Us
About the Site