Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 19th, 2004, 02:00 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
Default How i can OUTPUT in Stored Proc

i want to examine such this condition in my SP that
insert two values into a table and output some values by applying select clauses and put values in the ouput parameters i dont know if i haveto present values to this parameters or it is option becuase i dont like to give any values to this parameters and only i like to using this for output values i use such this code.
 
Quote:
quote:create proc ins_nazar6(@q1_value tinyint,@more ntext,@bad int=null output,@mid int=null output)
Quote:
         as
begin
insert into nazar_sanji(q1_value,more) values(@q1_value,@more)
end
begin
 select @mid=count(*) from nazar_sanji where q1_value=1
end
begin
 select @bad=count(*) from nazar_sanji where q1_value=1
end
is it correct

__________________
       YoOrD .
Beauty is not on the face
Beauty is on the heart
~~<<Ghibran Khalil>>~~
 
Old July 19th, 2004, 03:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

You have a default set on them of null. This value will be returned if no value is provided from the select.

From what I can tell, I don't see any syntax issues...

Is that what you were asking?

Brian
 
Old July 19th, 2004, 03:11 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
Default

hi brian thanx for your reply.
if use this SP like this and remove all null options is would it work again.
i like call this SP Like this
 
Quote:
quote:sp_in_nazar6 2,'test insert'

and i like it insert this values and return(OUTOUTs) For this 2 OUTOUTs
i dont know if this SP Yet Satisfies my goals.
Thanx In Advance.
YoOrD






Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling an insert stored proc from a select stored dzitam SQL Language 10 April 2nd, 2007 12:39 PM
Return output variable to VB from SQL stored proc busterbunny BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 1 March 27th, 2006 10:24 PM
Passing Output Parm From St Proc to DTS Package lwendt33 SQL Server DTS 2 February 2nd, 2005 05:15 PM
problems with stored proc and output parameters zieg42 VB.NET 2002/2003 Basics 1 June 12th, 2004 07:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.