Red Gate forums :: View topic - Qualify Object names - cross database reference
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Refactor 1
SQL Refactor 1 forum

Qualify Object names - cross database reference

Search in SQL Refactor 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
tkdennis



Joined: 29 Feb 2008
Posts: 74

PostPosted: Mon Jun 07, 2010 7:26 pm    Post subject: Qualify Object names - cross database reference Reply with quote

When I have a query that references tables from two databases database, SQL Refactor is not able to find them. If I put a USE <other_database_name> statement at the top (but don't execute it), then it will qualify the names, and tell me it couldn't find the objects from the first database.

Code:
   SELECT a_col1, b_col2
   FROM db1.dbo.table1 d1
   JOIN db2.dbo.table2 d2
      ON d1.a_col1 = d2.b_col2

becomes
Code:
   SELECT a_col1, d2.b_col2
   FROM db1.dbo.table1 d1
   JOIN db2.dbo.table2 d2
      ON d1.a_col1 = d2.b_col2

but underlines db1.dbo.table1 as not identifiable

so I add the USE statement
Code:
USE db1
   SELECT a_col1, d2.b_col2
   FROM db1.dbo.table1 d1
   JOIN db2.dbo.table2 d2
      ON d1.a_col1 = d2.b_col2

and I now I get this
Code:
USE db1
   SELECT d1.a_col1, d2.b_col2
   FROM db1.dbo.table1 d1
   JOIN db2.dbo.table2 d2
      ON d1.a_col1 = d2.b_col2

and it underlines db2.dbo.table2 as not identifiable.

I was in db2 with a USE db2 statement at the top of the script when I first tried it. I got the same result trying to qualify the script in a new window in a 3rd unrelated database without any USE statements - db2 was qualified and db1 was not identified.

Thanks,
Traci
SQL Refactor 1.5.1.61
Back to top
View user's profile Send private message
Anu Deshpande



Joined: 20 Apr 2009
Posts: 663
Location: Cambridge

PostPosted: Wed Jun 09, 2010 4:55 pm    Post subject: Reply with quote

Thanks for your post.

I am trying to replicate the issue and I will get back to you on this soon!
_________________
Anuradha Deshpande
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Back to top
View user's profile Send private message Send e-mail
Anu Deshpande



Joined: 20 Apr 2009
Posts: 663
Location: Cambridge

PostPosted: Wed Jun 23, 2010 2:45 pm    Post subject: Reply with quote

Many thanks for your post and apologies for delay in replying you.

I have added your request in our internal tracking system as a feature request whose tracking id is SR-892.

I will update you as soon as this feature is incorporated.

Thanks for your feedback and your patience.
_________________
Anuradha Deshpande
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group