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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Overload Stored Procedure: Is it possible (2005)?

Status
Not open for further replies.

cmwright

Technical User
May 5, 2005
47
US
Hi all,

I was wondering if SQL Server 2005 had the ability to overload stored procedures like the .NET programming languages can do with subroutines. I haven't touched it yet, and I was thinking that would be really cool.

-Chris
 
Blah. Site problems. Didn't realize this got posted earlier when I got a "Page can not be displayed error." Please reply to the other (duplicate) post. Sorry!

-Chris
 
Function Overloading is an inherent feature/property of Object Oriented Coding thus .NET supports it. TSQL is a Relational programming language and not an Object Oriented Coding language and will not support that feature. It also won't support other OO features like Inheritance etc.
 
Hi druer,

I figured as much. However, with the integration of .NET into 2005, the lines have blurred, and I was wondering how far they have blurred. For example, Try...Catch is not a construct that can be used. Is that an answer based off of 2000, or have you been using 2005?

Thanks!

-Chris
 
Try...Catch can be used in SQL Server 2005 procedures

BEGIN TRY
DECLARE @X INT
-- Divide by zero to generate Error
SET @X = 1/0
PRINT 'Command after error in TRY block'
END TRY
BEGIN CATCH
PRINT 'Error Detected'
END CATCH
PRINT 'Command after TRY/CATCH blocks'


Denis The SQL Menace
SQL blog:
Personal Blog:
 
Typo. "not a construct" = "now a construct" :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top