David Birin's blog
Does i+me == i++ ???
Browse by Tags
All Tags
»
SQL
»
T-SQL
(
RSS
)
DEV
Different behaviors between select to variable in SQL
I encountered different behaviors between the two syntaxes of select to variable in SQL. The first type of select has the following syntax: SELECT @ Variable = C FROM T and the second syntax: SET @ Variable = ( SELECT C FROM T) When the query result is a single value the behavior of both is the same (as expected the query result will be placed into the variable). Things become more difficult when the query returns more than one result, or zero results as can be seen in the following examples: For...
Search
Go
This Blog
Home
Tags
ASP.NET
C#
C++/CLI
DEV
Embedded Resources
Entity Framework
Excel Services
Hebrew
IIS
Internet Explorer
JavaScript
MOSS
SharePoint
SharePoint Designer
SQL
T-SQL
WF
Workflow activity
WPF
WSS
XSL
Navigation
Home
All Posts
RSS
Popular Tags
Archives
September 2010 (1)
August 2010 (1)
January 2010 (1)
November 2009 (1)
July 2009 (1)
June 2009 (1)
May 2009 (1)
March 2009 (1)
January 2009 (3)
December 2008 (2)
July 2008 (2)
Syndication
RSS
Atom
Comments RSS