Jan 3, 2012 at 10:39 PM
Edited Jan 3, 2012 at 11:00 PM
I was very pleased to find this tool and so far it has been a gem in achieving the results I need. The biggest reason I chose to use this tool is the handling of text. I am creating an auto-matted migration system, it's working very well
but is designed to mingle with up to 3 different databases at a time.
The changing of the database context was achieved with a simple sql statement much like the below statement, where [somedatabase]=customer data and [migrationdatabase]=migration application database because the only known of the customers database is
the name, until my app analyzes it.
USE [somedatabase]; select something; USE [migrationdatabase];
Unfortunately it seems this tool does not handle this well, as is seems to loose my database context to the applications database.
1) does the ability to change the database context from underneath itself provided?
2) Can I work with multiple databases from same database connection or do I need to create a database context for each database I need to reach out to and write the code to be a bit more thoughtful?
Just seems like in today's technology the concept of accessing multiple databases should work, ie. shared databases - I must be missing something, can anyone help put me on the right track?
Thanks in advance!
I did find this:
The SQLSRV extension does not have a dedicated function for changing which database is connected to. The target database is specified in the $connectionOptions array that is passed to sqlsrv_connect. To change the database on an open connection, execute
the following query "USE dbName" (e.g. sqlsrv_query($conn, "USE dbName")).
BUT - Does this mean I can't send a qry like this:
"USE [somedatabase]; select something; USE [migrationdatabase];"
and have it execute ALL three statements?