SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Insert multiple rows into variable

By Megan Beebe,

Paste the above script into a query window and see the results. The first time I saw this, I expected to see only the last row's data in the variables.

The best use I've found for this behavior is select the values out of syscolumns into a single string that I can easily paste into a select statement.

Total article views: 3369 | Views in the last 30 days: 2