Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure Variable

Status
Not open for further replies.
Apr 6, 2004
33
US
Hello,
How you declare variables to use with a SQL Server stored procedure? I am performing some calculations and need to return the results to a variable, and do some other calculations on that variable. Also can you pass variables from vb.net to a stored procedure?

Thanks
Tim

 
The syntax for the procedure is
Code:
create procedure dbo.usp_proc
   @Var1 varchar(10),
   @Date datetime
as
{code goes here}
go

Then run the procedure like this:
Code:
exec dbo.usp_proc @Var1='test', @Date='01/12/2003'

Denny

--Anything is possible. All it takes is a little research. (Me)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top