How can we help you today? How can we help you today?

Two part name joins for three part name data tables

Having a database building database I frequently access external database schemas from the build database. So for instance where I have a database called External_DB I may use the following query..


Select {something usefull} from External_DB.sys.tables inner join External_DB.sys.schemas on tables.schema_id = schemas.schema_id.... and so ona nd so forth.

When naming the join criteria in this scenario I can alias the sources, but am generally can't be bothered, so I am stuck with using either two part (tables.schema_id) of four part (External_DB.sys.tables.schema_id) naming convention . 'Tis a real pain then that Red gate tries three part (sys.tables.schema_id) naming which is in this case illegal as the names cannot be resolved. :roll:

I suppose in case I am going across DB's then it (SQL Prompt) should use 4 part, well that is until I can get into the habit of aliasing.....
Niall
0

Comments

3 comments

  • Anu D
    Many thanks for your post and we appreciate the requirement specified by you.

    Please feel free to add your vote or if there is one already kindly vote for it:

    http://redgate.uservoice.com/forums/944 ... uggestions

    And then the project manager can directly decide what category this requirement comes under?
    Anu D
    0
  • Niall
    Actually I think this isa bug, as in the tool generates invalid SQL, not a feature request, can you please fix it without polling folk about the priority.
    Niall
    0
  • Chris_le_2017
    Quick question, how do we handle the 4-part-name in SQL Compare?
    Chris_le_2017
    0

Add comment

Please sign in to leave a comment.