473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

purpose of OUTPUT keyword in sql server


hello sirs
purpose OUTPUT keyword with examples

May 17 '06 #1
3 2553
surya (su*******@gmail.com) writes:
hello sirs
purpose OUTPUT keyword with examples


You use OUTPUT to specify that a parameter is an output parameter:

CREATE PROCEDURE getordercount @custid int, @cnt OUTPUT AS
SELECT @cnt = COUNT(*) FROM orders WHERE custid = @custid

What is special with T-SQL, is that you need to specify OUTPUT also when you
call the procedure:

EXEC getordercount @custid, @cnt OUTPUT
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
May 17 '06 #2
Erland,

you said right about OUTPUT parameters...
but what about the OUTPUT clause of
DELETE, INSERT and UPDATE statements
in SQL Server 2005?

surya, for more details about the OUTPUT clause see the following link:
http://msdn2.microsoft.com/en-us/library/ms177564.aspx

---
Andrey Odegov
av******@yandex.ru
(remove GOV to respond)

May 17 '06 #3
avode (av********@yahoo.com) writes:
you said right about OUTPUT parameters...
but what about the OUTPUT clause of
DELETE, INSERT and UPDATE statements
in SQL Server 2005?
Sorry! There's so much new stuff, that I tend to forget some of it.
The OUTPUT clause in one of the more obscure items.
surya, for more details about the OUTPUT clause see the following link:
http://msdn2.microsoft.com/en-us/library/ms177564.aspx


....and if it was in that context you asked about OUTPUT, surya, please
tell us if you want more clarifcation.

Thanks for posting the link Andrey.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
May 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

66
by: Darren Dale | last post by:
Hello, def test(data): i = ? This is the line I have trouble with if i==1: return data else: return data a,b,c,d = test()
3
by: b_naick | last post by:
I am in the process of importing an Oracle database into SQL Server. Once of the tables has a field called "EXEC". SQL Server seems to reject any queries that include that particular field...
3
by: Bob | last post by:
C# newbie here.... studying about delegates and now events. I just don't get the purpose of declaring events using the event keyword. What does this do for me that can't be done using only...
3
by: Arthur Dent | last post by:
Hi all, Im just curious, what is the purpose of the keyword "Overloads" in VB nowadays? I understand conceptually what overloads are and what they do, but im a little puzzled, because if you...
4
by: Miro | last post by:
Vb2003, im still learning vb.net but I do not understand my output from this logic. If someone can help me out here. Cor Ligthert, you I believe were on the right track of what Im trying to...
1
by: yohan610 | last post by:
i have to read the binary data of a file, then encrypt them according to a supplied algorithm...and then the obtained output has to be written to an output file...everything works ok, and there are...
3
by: Sean DiZazzo | last post by:
Why is the following not working? Is there any way to get keyword arguments working with exposed XMLRPC functions? ~~~~~~~~~~~~~~~~ server.py import SocketServer from SimpleXMLRPCServer import...
0
gauravgmbhr
by: gauravgmbhr | last post by:
Hi All, I am using a application that stores a scripts in a sql server table columns some times i require to use the scripts stored in table columns in a file. So i am lookin for a keyword...
4
by: ANURAGBAJPAI | last post by:
This is a question in my text book, and the answer is- The keyword void in a function declaration has a significant purpose.When the return type of a function is void , that means the function...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.