Re: Whats the difference?

From: Tibor Karaszi <no_at_spam.com>
Date: Sat, 31 Aug 2002 09:55:13 GMT
Message-ID: <5o0c9.5128$e5.825175_at_newsb.telia.net>


What context?

I don't know if "USE" is a standard command, but in SQL Server (as you probably know), you switch database context with it. Besides making the code more readable and allow you to have, say, both a development database and a test database on same dbms instance (as you don't hard code database name in your code), it also improves performance to "be in" current database and not qualify object access with database name. Qualifying object access with object owner name improves performance, however (reduces risk for re-compilations).

Above is based on MS SQL Server experience, I can't vouch for other DBMS's. Ansi terminology for "database" is "catalog" and for "object owner" is "schema", btw.

--
Tibor Karaszi


"tim erickson" <dockersblack_at_hotmail.com> wrote in message
news:cfbf4f63.0208301454.9371918_at_posting.google.com...

> Whats the difference between these two statements?
> 1.
> "Use foo
> select * from bar"
>
> 2."select * from foo..bar"
Received on Sat Aug 31 2002 - 11:55:13 CEST

Original text of this message