Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

USE Schema option? 1

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
US
When you have a connection in a query dialog on SQL server, what is the command to specify the current schema you are working on.

You can set a default schema to a user but how can you move around from one schema to another. I'm after something like:-

USE MyDatabase.MySchema;




Dazed and confused
 
There is no use schema command.

You specify the schema in the select statement.

like this..

SELECT *
FROM MyDB.Schema.table

Or

SELECT *
FROM schema.table

- Paul [batman]
- If at first you don't succeed, find out if the loser gets anything.
 
OK thanks.

I couldn't remember seeing one.
I just figured that commands might use the schema you are in over the defaultschema when you don't specify a schema - if you know what I mean.

Many thanks.

Dazed and confused
 
Np. If you don't specify a schema you select from the dbo schema.


- Paul [batman]
- If at first you don't succeed, find out if the loser gets anything.
 
If you don't specify a schema you select from your default schema (which may or may not be dbo). I beleive that after checking your default schema then dbo is checked.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top