Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 331
  • Last Modified:

autoshrink settings through code

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

thanks
0
anushahanna
Asked:
anushahanna
2 Solutions
 
Aneesh RetnakaranDatabase AdministratorCommented:
ALTER DATABASE  dbName SET AUTO_SHRINK ON  
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
select databaseproperty (dbname ,  'IsAutoShrink'  )
0
 
anushahannaAuthor Commented:
Aneesh, could we get this setting for all the databases in one query?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Aneesh RetnakaranDatabase AdministratorCommented:
SELECT name,  databaseproperty (name ,  'IsAutoShrink'  )IsAutoShrink
 from sys.databases
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

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now