Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Programming / SQL / July 2008

Tip: Looking for answers? Try searching our database.

How exec a sproc with parms with defaults

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mscertified - 18 Jul 2008 23:36 GMT
here are my parameters:

CREATE Procedure dbo.ESIMonthly
(
    @ProcessDate DateTime = Null,
    @SubsidyPerChild SmallMoney = 100.00,
    @Rerun bit = 0,
    @Payments int OUTPUT,
    @TotalPaid Money OUTPUT
)

since first 3 parms have defaults how do I execute this without specifying
the parameters but still grabbing the output paramaters? I tried
EXEC dbo.ESIMonthly ,,, @Payments OUT, @TotalPaid OUT
but it did not like it
Plamen Ratchev - 19 Jul 2008 00:00 GMT
You can execute explicitly naming the parameters and skipping those with
defaults:

EXEC dbo.ESIMonthly @Payments = @Payments OUT, @TotalPaid = @TotalPaid OUT;

Or use the DEFAULT keyword in place of those parameters that you do not want
to specify:

EXEC dbo.ESIMonthly DEFAULD, DEFAULT, DEFAULT, @Payments OUT, @TotalPaid
OUT;

HTH,

Plamen Ratchev
http://www.SQLStudio.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.