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.
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!
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.
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?
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'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.