Check if I can execute some sql-command

Posted by Alexander Stalt on Stack Overflow See other posts from Stack Overflow or by Alexander Stalt
Published on 2010-02-09T07:38:02Z Indexed on 2010/05/17 2:40 UTC
Read the original article Hit count: 348

Filed under:
|
|
|

I'm using ADO .NET and MS SQL Server 2008.

I have a connection object to a server and a command:

SqlConnection conn = /* my connection*/;
string cmd = "some_sql_command";

I want to check if SQL Server can execute cmd. I don't want to execute cmd, but I want to know If SQL Server can execute it.

cmd can be any single SQL statement, it's not a procedure, transaction or multiple commands etc..

© Stack Overflow or respective owner

Related posts about ado

Related posts about .NET