What i wish to do is rather than writing Choose something From [Parent].[dbo].[Tabel], i wish to declare the very first 2 before i write the query, then when i must use several chooses, i do not have to specify [parent].[dbo] constantly. Things i remember is you can make a move such as this:
use [parent].[dbo] select something From tabel
This appears to create warning 102, in the "." attempted searching this but all i recieve i "use" while doing produced queries, nothing related to database names.
If the looks familiar to a person, please publish us a reply, tnx.
The dbo part is implied. Simply do this:
use [parent] select something From tabel
As Damien_The_Unbeliever stated, the dbo part is just implied if dbo may be the user's default schema.
Parent should be your Database.
So if you wish to make use of a particular database without indicating it:
DBO is implied, but when you need to use another schema, you will have to specify the schema inside your SQL, ala
Just in case you are not utilizing it, you may also lessen the clutter inside your code by utilizing aliases for the tables, ala
SELECT a.Column1, a.Column2
FROM table1 a JOIN
table2 b ON a.Column1 = b.Column1
WHERE a.column1 = 'SomeValue'
in which the
a that follows the table1 is definitely an alias for table1, essentially your giving the table a nickname with this query. Same factor for that b, it's an alias for table2. This really is a smaller amount cluttered than
SELECT table1.Column1, table1.Column2 FROM table1