How to read the database name using QSRules?

Mar 29, 2006 2 Replies

Is there any way of reading the database name using QSRules?



The Session.ConnectionInfo object would be an obvious place, but I get "Object doesn't support this property or method" when I try to access the InitialCatalog property...


Simon,

Could try the following SQL:-

declare @dbname as varchar(32) select @dbname = db_name() print @dbname

R.

set rs = Session.OpenRecordset("SELECT GetDate()", true)

rs is an ADODB.Recordset

You can take it from there...

Glenn Adams Tiber Creek C> Is there any way of reading the database name using QSRules?

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required