Posted by fireball on 01/02/07 15:58
Uzytkownik "Erland Sommarskog" <esquel@sommarskog.se> napisal w wiadomosci
> Use two-part names, not three-part names.
but why??
I wisht to say, for example:
SELECT * FROM somebase.sys.schemas
WHERE name = N'someschema'
or (- I don't know which query will be more proper, to obtain schema of
given database):
SELECT * FROM somebase.INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME = N'someschema'
but without saying:
USE somebase
- (why) is that wrong solution?
hint: I parametrize my database name in my scripts.
[Back to original message]
|