0
Answer

Out Parameter for User Defined Function?

Brandon Lewis

Brandon Lewis

16y
6.1k
1
Hello, Im just getting into SQL Server 2005 and the Transact SQL language and was wondering if there is any way to have an out parameter like C# has. Something like this:

public bool PhoneNumberIsValid(string phoneNumber, out string errorMsg)
{
   // Do some validation code, and if an error is encountered, assign an error message to the errorMsg parameter and return false.
}


Something like that, only for SQL. Im trying to handle some errors before they occur, but havent found any good solution for preemptive error catching and notification. Thanks!
Next Recommended Forum