473,406 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Default Stored Procedure Parameters

Hello, does anyone know how to determine (within the stored procedure)
whether a parameter has been passed explicitly to a stored procedure as
opposed to a parameter that has taken on the default value.
Many thanks
Phil

Jul 23 '05 #1
4 4027

<te*******@skunkbox.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hello, does anyone know how to determine (within the stored procedure)
whether a parameter has been passed explicitly to a stored procedure as
opposed to a parameter that has taken on the default value.
Many thanks
Phil


Not as far as I know. You could add code which compares the initial
parameter values to a list of the defaults, but that wouldn't cover the case
where someone explicitly passes the default value.

Simon
Jul 23 '05 #2
I don't know of a passive way, but you could create another parameter such
as a bool bIsDefault that defaults to TRUE. Then have calling functions pass
a FALSE value to this if they pass any other parameters.

Just a thought.
Cheers!

"Simon Hayes" <sq*@hayes.ch> wrote in message
news:41********@news.bluewin.ch...

<te*******@skunkbox.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hello, does anyone know how to determine (within the stored procedure)
whether a parameter has been passed explicitly to a stored procedure as
opposed to a parameter that has taken on the default value.
Many thanks
Phil


Not as far as I know. You could add code which compares the initial
parameter values to a list of the defaults, but that wouldn't cover the
case where someone explicitly passes the default value.

Simon

Jul 23 '05 #3
There are no BOOLEAN data types in SQL-92; they would make no sense in
terms of 3VL and NULL rules.

The guy can check the values as they come into the procudure with an IF
statement in the body or with a CASE expression in the SQL.

Jul 23 '05 #4
--CELKO-- (jc*******@earthlink.net) writes:
There are no BOOLEAN data types in SQL-92; they would make no sense in
terms of 3VL and NULL rules.


Don't be silly. In such case neither AND or OR would make sense. Or anything
make sense. Real-world databases are full of boolean values, because
real-world business needs is full of boolean values.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Mark Flippin | last post by:
This is for a reporting problem using: Access 2000 SQL Server 2000 Both at SP3 I've a stored procedure in SQL Server 2000 which builds a result set from a disparate set of tables, utilizing...
2
by: Aragorn | last post by:
I want to load into a SqlCommand objet an existing stored procedure. I know that by using the Parameters collection I can add parameters, but how can I retrieve the parameters already defined from...
2
by: Eli | last post by:
Hi all We currently have a strange problem with calling a Stored Procedure (SQL Database) in our C# Project. The only error I get is "System error" which says a lot :) Background: We have...
3
by: Bilbo | last post by:
I have a a headscratcher here: I have a form that when submitted should do 2 things when a user enters data and then clicks the Add button. Here goes: 1. Call a stored procedure called...
9
by: joun | last post by:
Hi all, i'm using this code to insert records into an Access table from asp.net, using a stored procedure, called qry_InsertData: PARAMETERS Long, Long, Text(20), Long, DateTime; INSERT...
5
by: ric_deez | last post by:
Hi there, I would like to create a simple search form to allow users to search for a job number based on a number of parameters. I think I understand how to use parameteres associated with Stored...
9
by: fniles | last post by:
I am using VB.NET 2003 and SQL2000 database. I have a stored procedure called "INSERT_INTO_MYTABLE" that accepts 1 parameter (varchar(10)) and returns the identity column value from that table....
0
by: bobby_b_ | last post by:
Hello, I'm trying to access a stored procedure on our AS400 that is written in RPG. I know that the stored procedure works (I've called it from an RPG program on the AS400), and I know that the...
6
Soniad
by: Soniad | last post by:
Hello, I am excecuting a stored procedure in my ASP page , it has one out parameter (@confirm) . after executing the procedure i want to retreive this out parameter and assign it to variable...
7
by: jamesclose | last post by:
My problem is this (apologies if this is a little long ... hang in there): I can define a function in VB.NET with optional parameters that wraps a SQL procedure: Sub Test(Optional ByVal Arg1...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.