Two part name joins for three part name data tables
Niall
Posts: 36 Bronze 1
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.....
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.....
Comments
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?
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com