How is it possible to execute a direct SQL command to an ADO.NET connected database?
I want to send a DBCC SHRINKDATABASE to the SQL server, to compress the current datafile after a big deletion process. The function ObjectContext::CreateQuery returns a parser error after the DBCC command. Is there any other way to shrink the database file, or another way to send the SQL command directly to the SQL Server?
How is it possible to execute a direct SQL command to an ADO.NET connected
Share
I’d just send this as raw SQL:
Another way is to put the
DBCC SHRINKDATABASEin a stored procedure and call the stored procedure from your code.