views:

359

answers:

1

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?

+1  A: 

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

ElHombre