Question

I have several assemblies for SQL Server 2005.

If invalid data is entered to be run by my SP function (using C#), I want to pass back an error to sql server.

For example, if someone enters something I don't want them to then I want to output something back to SQL Server prior to executing any query.

Any ideas?

Was it helpful?

Solution

Throw an exception. Or, if you're using the SQL Context Connection, you can use SqlPipe to call 'raiserror' in SQL.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top