I'm not very familiar with SQL Server, more familiar with MySQL.
I'm used to seeing everything in code, whereas SQL Server, some things are done with buttons. In MySQL, I'd execute USE testing_database
and then I'd know my subsequent queries would execute against that database.
In SQL Server Management Studio, I see that my "Testing Database" is selected in the dropdown select. Does that mean that the queries in the script will execute ONLY against that database?
The script does not include any references to database names. It uses sp_msdependencies
to populate a list of Views and then acts on that list. Will sp_msdependencies
execute only against the current database?
There are several other databases besides the testing database that I do not want to touch with this test.
USE
statement. Perhaps you should test some with simpleSELECT
statements – AMtwo May 1 '17 at 6:23USE
statement to select a DB in MSSQL. You can select it with the GUI using the dropdown or in the Explorer-like sidebar. – Buttle Butkus May 1 '17 at 19:02USE
statement. The drop down is a feature of the SSMS GUI. TheUSE
statement is part of T-SQL, and would apply to any script applied to SQL Server via any method. – AMtwo May 1 '17 at 19:13USE
statement. – AMtwo May 1 '17 at 19:14