Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 How to define in sql server the same parameter as

Author  Topic 

Swapnil
Starting Member

3 Posts

Posted - 2006-07-26 : 03:22:28
Hi all,

Please help me in solving following query.

Can we define in sql server the same parameter as input and output?

How to do it?

Thanks and regards,

Swapnil.

Swapnil

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-07-26 : 03:33:01
Yes by setting the output parameter


Create proc Test
(
@p int out
)
As
Set @p =0
return @p


On the above sample code @p will be acting as the input, as well as out put parameter.

for details check on Book online under output parameters.

Chirag
Go to Top of Page

Swapnil
Starting Member

3 Posts

Posted - 2006-07-26 : 07:49:52
Thanks Chirag,

following is the other method I got from someone

--objects
create proc #sp1 @x int output as
set @x = @x + 1
go

--calculation
declare @x int
set @x = 7
exec #sp1 @x output

select @x

--tidy
drop proc #sp1

/*results
-----------
8
*/


Swapnil
Go to Top of Page

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2006-07-26 : 08:05:42
quote:
following is the other method I got from someone
You could at least mention me, Swapnil

http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=297318



Ryan Randall
www.monsoonmalabar.com London-based IT consultancy

Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-07-26 : 09:03:10
quote:

http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=297318



Giving me Access denied

Chirag
Go to Top of Page

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2006-07-26 : 09:19:50
quote:
Giving me Access denied
It's not important - there's nothing particularly exciting on that page.

I guess you'd need to log in to access it


Ryan Randall
www.monsoonmalabar.com London-based IT consultancy

Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-07-26 : 09:47:40
quote:

I guess you'd need to log in to access it


Aww need to create on over there then

Chirag
Go to Top of Page

Swapnil
Starting Member

3 Posts

Posted - 2006-07-27 : 04:54:31
Sorry Ryan Randall for not mentioning your name.

I am not saying that this is my code. I just did not mentioned your name that's it.

Once again sorry for that and thanks for help.

Regards,

Swapnil.

quote:
Originally posted by RyanRandall

quote:
following is the other method I got from someone
You could at least mention me, Swapnil

http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=297318



Ryan Randall
www.monsoonmalabar.com London-based IT consultancy

Solutions are easy. Understanding the problem, now, that's the hard part.



Swapnil
Go to Top of Page

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2006-07-27 : 05:04:12
It's okay, Swapnil - I was just messin'

Ryan Randall
www.monsoonmalabar.com London-based IT consultancy

Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page
   

- Advertisement -