Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase ««12

How to eval @Variable when assigned from SELECT field? Expand / Collapse
Posted Tuesday, October 2, 2012 11:36 AM



Group: General Forum Members
Last Login: Yesterday @ 2:11 PM
Points: 13,886, Visits: 13,457
3. If multiple records found in sys.columns you will NOT cause get run-time error and will be set to one of values returned by SELECT (you cannot guarantee which one) 

Actually you do know which one. It is the LAST value selected. With no order by on the query you don't know, but if you add an order by you know exactly which one it will return.


Need help? Help us help you.

Read the article at for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1367200
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse