Qualify Object names - changed schema

Refactors and formats SQL code.

Moderators: Chris Auckland, David Atkinson, Anu Deshpande, Luke Jefferson

Qualify Object names - changed schema

Postby tkdennis » Tue Jun 08, 2010 4:35 am

I applied the Qualify Object Names to a whole script, and it changed tables that already had schema names to use the dbo schema. It happened when I changed the USE <database> statement at the top of the script in order to get it to qualify the cross-database references. The other database had tables in the dbo schema.

Code: Select all
TRUNCATE TABLE dn.table1

to
Code: Select all
TRUNCATE TABLE dbo.table1


Thanks,
Traci
tkdennis
 
Posts: 75
Joined: Fri Feb 29, 2008 1:13 am

Postby Anu Deshpande » Wed Jun 09, 2010 1:56 pm

Many thanks for your post.

What happens when you remove the Use database statement and select the database which has table 'Table1' in 'dn' schema?
Anuradha Deshpande
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Anu Deshpande
 
Posts: 692
Joined: Mon Apr 20, 2009 3:53 pm
Location: Cambridge


Return to SQL Refactor 1

Who is online

Users browsing this forum: No registered users and 0 guests