Page 1 of 1

GetDatabaseNames: SQL-Server problem

Posted: Fri 07 Dec 2012 10:58
by formi
Hi

I noticed that when I call UniConnection1.GetDatabaseNames(..) then SQL Server reaches a stae where it always starts the databases.

Just wrote an example nothing doing than calling UniConnection1.GetDatabaseNames once. After this the Windows-Event Viewer shows many events "database xy started". This stops only after restarting the sqlServer-Service.

Have I to call another method or is this a bug? Installed version: UniDAC 4.5.9 for D XE2

Peter

Re: GetDatabaseNames: SQL-Server problem

Posted: Fri 07 Dec 2012 12:17
by AndreyZ
Hello,

Most probably, these events occur because the AutoClose property of your database is set to ON on the server. For more information about the AutoClose property, please read the following articles:
http://msdn.microsoft.com/en-us/library/ms135094.aspx
http://msdn.microsoft.com/en-us/library/ms190249.aspx
To avoid this problem, you should set the AutoClose property to OFF. For this, you can use the following SQL statement:

Code: Select all

ALTER DATABASE YourDatabaseName SET AUTO_CLOSE OFF;

Re: GetDatabaseNames: SQL-Server problem

Posted: Fri 07 Dec 2012 12:31
by formi
I didn't test if that is the problem but if I want to know which databases are on the server this option doesn't seem useful because it is a command that refers to the database. So I prefer to use this command to get the databasenames:

Code: Select all

SELECT name FROM master..sysdatabases WHERE dbid > 6
Peter

Re: GetDatabaseNames: SQL-Server problem

Posted: Fri 07 Dec 2012 13:14
by AndreyZ
You can see database names in event messages.