Monday, March 12, 2012

retrieving connection parameters

I would like retrieve a connection's server and initail catalog to store in an audit file.

What object contains this information and could you point me to some sample code that accesses this information from a script somponent?

In the script component, add a connection (say, MyConnection) to the component using the Connection Managers tab in the Script Component Editor. Then, in the script, you can reference

Me.Connections.MyConnection.ConnectionString

to retrieve the connection string. The server and initial catalog are not available from within the script component but you could parse out information you want from there.

Donald

No comments:

Post a Comment