Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using SET versus SELECT

Posted on 2001-06-25
6
Medium Priority
?
272 Views
Last Modified: 2008-02-20
What is the difference?  Is either way better?  Any tips?
0
Comment
Question by:svfafel
6 Comments
 
LVL 18

Expert Comment

by:nigelrivett
ID: 6225522
Microsoft advise set as ansii standard but there isn't much difference (except learning to type two different words).
0
 
LVL 3

Expert Comment

by:mgmanoj
ID: 6225661
Set is to assign the values to a variable or expressions to a variable & it does not displays the result in output while select displays in the result set it can be also used to assign.
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 400 total points
ID: 6226470
i agree with mgmanoj, especially if you have stored procedures with SELECT instead of SET, you might need to
use the SET NOCOUNT ON at the beginning of the stored procedure to avoid the "empty" recordsets...

CHeers
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 2

Expert Comment

by:ZhongYu
ID: 6226656
In the case of assignment, like set @test=1, you can use whichever you like. SET is ansi standard, its more clean to me. SELECT let you assign several values at the same time.
 

0
 

Author Comment

by:svfafel
ID: 6227561
Thank you to all!!! I wish i could give points to everyone....
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6227611
For mgmanoj:
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=mssql&qid=20141705

Sorry nigel, as you did only complain, no points today! (just joking)
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question