Send shrink Command to Microsoft SQL Database file via Ado.net connection

Posted by user287107 on Stack Overflow See other posts from Stack Overflow or by user287107
Published on 2010-03-29T23:00:42Z Indexed on 2010/03/29 23:03 UTC
Read the original article Hit count: 280

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about ADO.NET

Related posts about sql