autoshrink settings through code

I can see the database auto shrink property through GUI. What will the equivalent code to see the same?

thanks
LVL 6
anushahannaAsked:
Who is Participating?
 
Aneesh RetnakaranDatabase AdministratorCommented:
SELECT name,  databaseproperty (name ,  'IsAutoShrink'  )IsAutoShrink
 from sys.databases
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
ALTER DATABASE  dbName SET AUTO_SHRINK ON  
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
select databaseproperty (dbname ,  'IsAutoShrink'  )
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
anushahannaAuthor Commented:
Aneesh, could we get this setting for all the databases in one query?
0
 
dportasCommented:
Is this for Microsoft SQL Server? If so then the autoshrink property should always be set OFF (the default), never ON. Autoshrink is a deprecated feature and should not be used.
0
 
anushahannaAuthor Commented:
Thanks Aneesh.

dportas,
I do see one DB with AutoShrink as True.. when you say 'deprecated', you  mean the versions that are coming up will not have it?
0
 
dabbiXCommented:
procedure Button10Click(Sender: TObject);
////
procedure TFrmBokhald.Button12Click(Sender: TObject);
begin
TFrmBokhald.Create.Button10Click;
end;
can I do this  ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.