473,394 Members | 1,701 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,394 software developers and data experts.

Determining if a parameter exists in a stored procedure

Hey,
I'm writing some automated unit tests for a database app. The app
creates a database via script. I'm developing the system in a
test-driven manner and need a way to determine if a parameter exists
within a stored procedure using SQL. Any ideas?

Thanks,
Will
fo*******@hotmail.com
Jul 20 '05 #1
3 5183
Hi

It is not clear what you exactly want but the INFORMATION_SCHEMA.PARAMETERS
view may help?

John

"Foehammer" <fo*******@hotmail.com> wrote in message
news:27**************************@posting.google.c om...
Hey,
I'm writing some automated unit tests for a database app. The app
creates a database via script. I'm developing the system in a
test-driven manner and need a way to determine if a parameter exists
within a stored procedure using SQL. Any ideas?

Thanks,
Will
fo*******@hotmail.com

Jul 20 '05 #2
I can test to see if a procedure exists as follows:

IF EXISTS ( SELECT * FROM dbo.sysobjects WHERE id =
object_id(N'[dbo].[PROCEDURENAME]')
AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
If the select statement returns any records, then I know that the
procedure exists. What I need is a way to get the information
associated with a procedure parameter so I can do the same thing. Any
ideas?

Will
fo*******@hotmail.com

"John Bell" <jb************@hotmail.com> wrote in message news:<8q*********************@news-text.cableinet.net>...
Hi

It is not clear what you exactly want but the INFORMATION_SCHEMA.PARAMETERS
view may help?

John

"Foehammer" <fo*******@hotmail.com> wrote in message
news:27**************************@posting.google.c om...
Hey,
I'm writing some automated unit tests for a database app. The app
creates a database via script. I'm developing the system in a
test-driven manner and need a way to determine if a parameter exists
within a stored procedure using SQL. Any ideas?

Thanks,
Will
fo*******@hotmail.com

Jul 20 '05 #3
Disregard my other post. That was exactly what I needed. Furthermore,
I can now fix a bunch of really hack-riddled code that I was using. I
had no idea whatsoever that those views were there (new to SQL
Server).

Thanks,
Will

"John Bell" <jb************@hotmail.com> wrote in message news:<8q*********************@news-text.cableinet.net>...
Hi

It is not clear what you exactly want but the INFORMATION_SCHEMA.PARAMETERS
view may help?

John

"Foehammer" <fo*******@hotmail.com> wrote in message
news:27**************************@posting.google.c om...
Hey,
I'm writing some automated unit tests for a database app. The app
creates a database via script. I'm developing the system in a
test-driven manner and need a way to determine if a parameter exists
within a stored procedure using SQL. Any ideas?

Thanks,
Will
fo*******@hotmail.com

Jul 20 '05 #4

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

Similar topics

1
by: N E | last post by:
hello I am trying to do a procedure that : 1 - Take a table name, a field name and a value as parameter 2 - check if the fieldname=value in the tablename table 3 - returns 1 if so, 0 if not ...
3
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
5
by: vivienne.netherwood | last post by:
I am developing an Access Project front end with a SQL server database. I have written a stored procedure that returns a record set and also a value via an output parameter. The procedure is as...
4
by: Ranginald | last post by:
Hi, I'm having trouble passing a parameter from my default.aspx page to my default2.aspx page. I have values from a query in a list box and the goal is to pass the "catID" from default.aspx...
5
by: Enyi | last post by:
Just like my last post I cannot solve this problem with a stored procedure in MSSQL Server 2000 Developer Edition. I am trying to use the parameter in VB.NET 2003. When I run the VB code and...
1
by: Arpan | last post by:
A SQL Server 2005 DB table named "Users" has the following columns: ID - int (IDENTITY) FirstName - varchar(50) LastName - varchar(50) UserID - varchar(20) Password - varchar(20) Before...
2
by: eflatunn | last post by:
Hi all, I paid 3 hours for it but couldn't get succeed. I'm writing a stored procedure to get a data entry in a table. The problem is that I can't simply use commands "SELECT" or "CASE" directy....
2
by: zombiemasta | last post by:
Hi, I've wrote a stored procedure which expects a parameter to be passed in on the WHERE clause for channelID. The stored procedure runs fine in Navicat for MySQL when you specify the parameter...
1
by: euroluxantiques | last post by:
Hi All, Using VB.Net with SQL Server. I have a form that I create a number of Picture Boxes on dynamically, based on a stored procedure that retrieves a listing of images available for a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.