Simple SQL Server Question
#1
I'm not particularly au fait with SQL Server, but.......
Is there an equivalent concept to "user qualified tables" within SQL Server. ie in Oracle + DB2, a database or schema can have similarly named tables, but qualified by user id (eg user1.Messages, and user2.messages can happily co-exist with the same, or different, formats) ?
If there is no such concept, and we have to use different databases to hold tables of the same name, is there a simple method of accessing both of these sets of tables without connecting individually to each database?
Sorry it's a bit vague, but any help gratefully received
Cheers
SB
Is there an equivalent concept to "user qualified tables" within SQL Server. ie in Oracle + DB2, a database or schema can have similarly named tables, but qualified by user id (eg user1.Messages, and user2.messages can happily co-exist with the same, or different, formats) ?
If there is no such concept, and we have to use different databases to hold tables of the same name, is there a simple method of accessing both of these sets of tables without connecting individually to each database?
Sorry it's a bit vague, but any help gratefully received
Cheers
SB
#2
Scooby Regular
Join Date: Sep 1999
Location: Bedfordshire
Posts: 4,037
Likes: 0
Received 0 Likes
on
0 Posts
hey scumbag (nice name!)
yes there is, when creating databases with an admin sign on (typically 'sa') they are created by user 'dbo' so your tablenames can be qualified using dbo.<tablename> (as can stored procs, triggers and views). If you create additional logins for a db then when that user creates a table (assuming they have DDL permissions) then the table is <user>.<tablename>, guess what Im actually saying in answer to your question is YES
cheers
Gary
yes there is, when creating databases with an admin sign on (typically 'sa') they are created by user 'dbo' so your tablenames can be qualified using dbo.<tablename> (as can stored procs, triggers and views). If you create additional logins for a db then when that user creates a table (assuming they have DDL permissions) then the table is <user>.<tablename>, guess what Im actually saying in answer to your question is YES
cheers
Gary
#3
Excellent - cheers Gary.
In fact exactly how Oracle does it (that'll teach me to scour through the Enterprise manager options, rather than just doing the obvious)
Many thanks
SB (name comes from something I was called at work a few years ago, and it just stuck !!)
In fact exactly how Oracle does it (that'll teach me to scour through the Enterprise manager options, rather than just doing the obvious)
Many thanks
SB (name comes from something I was called at work a few years ago, and it just stuck !!)
Thread
Thread Starter
Forum
Replies
Last Post
Brzoza
Engine Management and ECU Remapping
1
02 October 2015 05:26 PM
Phil3822
General Technical
0
30 September 2015 06:29 PM