Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check SQL Compact Auto Shrink setting?

Quick context of my problem, some of our compact databases in production are going corrupt and we need to do investigate the cause. I found some great pointers here, one of them being "Turn off Auto-Shrink".

So my question is How do I check what my Auto Shrink level is on an existing compact database?

With Sql Server I can use sys.databases as follows:

SELECT
   name,
   is_auto_shrink_on
FROM sys.databases

But alas sys.database does not exist in SQL Compact (understandably so).

I've read here at MSDN that you can set the Auto_Shrink value in the connection string and they mention that the default Auto_Shrink value is 60. This is great, but in my case I need to find out what the Auto_Shrink is on an existing database, not change it.

Does Auto_Shrink perhaps work differently with a compact database and I am misunderstanding it?

like image 887
Niels Filter Avatar asked Nov 09 '22 12:11

Niels Filter


1 Answers

It is specified as a per session setting, so you need to look at the connection string in use.

It is also important the client uses the latest SQL Compact enigine binaries.

like image 93
ErikEJ Avatar answered Nov 14 '22 22:11

ErikEJ