Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Selecting default database...

Author  Topic 

NewMedia42
Starting Member

35 Posts

Posted - 2001-10-17 : 19:36:14
Is there a way to set the default database for a user in an SQL query? For example, UserA has access to DB1, DB2, and DB3; DB1 is their default database. Each one contains the same information (basically), so something like this:

select DB2.dbo.Files.Name FROM DB2.dbo.Files

could be replace by something like:

sql set database DB2
select Files.Name FROM Files

(obiously sql set is not a real command). Is there anything like this, or am I just dreaming?
   

- Advertisement -