Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

insertion of parameters Expand / Collapse
Author
Message
Posted Thursday, April 1, 2010 9:25 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, September 29, 2010 11:33 AM
Points: 2, Visits: 4
how can v insert parameters into procedure
Post #894927
Posted Thursday, April 1, 2010 9:30 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 2:44 AM
Points: 5,018, Visits: 10,532
April fools?

Do you really want somebody to answer this, posed this is a question?

Take a look at the link in my signature, you'll find the right way to ask a question on a forum.


--
Gianluca Sartori

Get your two-cent-answer quickly
spaghettidba.com
@spaghettidba
Post #894935
Posted Thursday, April 1, 2010 10:14 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 6:32 PM
Points: 11,194, Visits: 11,140
johnhectar (4/1/2010)
how can v insert parameters into procedure

?




Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #895002
Posted Thursday, April 1, 2010 10:56 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 3:58 AM
Points: 15,659, Visits: 28,045
Assuming this is a serious question...

Since I'm unclear what you're asking, I'll tell you how to define parameters for your procedure. Assume you want to pass a column called ID to a procedure. You'd do this:

CREATE PROCEDURE dbo.MyProc
(@ID int)
AS...

The parameter is @ID. It's defined as an integer.

Is that what you're looking for?


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #895074
Posted Friday, April 2, 2010 11:48 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, September 29, 2010 11:33 AM
Points: 2, Visits: 4
Thank you and how can i execute a procedure......
Post #895885
Posted Friday, April 2, 2010 11:55 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 3:58 AM
Points: 15,659, Visits: 28,045
johnhectar (4/2/2010)
Thank you and how can i execute a procedure......


Well that depends on the context. Depending how you are connecting to the database server, different rules are going to apply. I'll assume you're connecting using SQL Server Management Studio and that you're running this through a query window. To execute a procedure you do this:

EXEC dbo.MyProc @Param1 = 42, @Param2 = 24

So, clearly you're calling EXEC to execute the procedure (you can also call EXECUTE). 'dbo' is the schema that owns the proc. MyProc is the name and the other two values are parameters and the values that you're setting them to. That's going to vary between procedures of course.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #895894
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse