Probably quite a simple one, have patience...I'm just learning the
ropes with SQL Server...
I want to grant new users access to an existing database, owned by
user X. So far this works, but user Y has to include X's username
before any object names. For example
select * from cd_collection;
does not work, Y has to use
select * from X.cd_collection;
instead. Any advice on how to add new users (with varying permissions)
to an existing "schema" so that they would have the schema as default
one? SQL Server version is 7.0.Hi
In SQL Server 7 or 2000 you can not change this.
Kalen Delaney wrote an article in the April SQL Server magazine " "Object
Ownership and Security" (InstantDoc ID 41773), I talked about the confusions
and limitations surrounding SQL Server 2000's model, which doesn't separate
the concepts of user and schema." This also talks about the changes in SQL
Server 2005 (Yukon).
http://www.winnetmag.com/SQLServer/...1773/41773.html
John
"janne" <janne_1976@.hotmail.com> wrote in message
news:6539de6f.0406142332.6de2004d@.posting.google.com...
> Probably quite a simple one, have patience...I'm just learning the
> ropes with SQL Server...
> I want to grant new users access to an existing database, owned by
> user X. So far this works, but user Y has to include X's username
> before any object names. For example
> select * from cd_collection;
> does not work, Y has to use
> select * from X.cd_collection;
> instead. Any advice on how to add new users (with varying permissions)
> to an existing "schema" so that they would have the schema as default
> one? SQL Server version is 7.0.
Showing posts with label schema. Show all posts
Showing posts with label schema. Show all posts
Monday, March 19, 2012
Monday, February 20, 2012
Multiple row update ina table from another table
Hi,
I have the foll schema.
table1:
*P,A,B,C
table2:
*P,A,B,C
Consider the records in the table:
table1:
P A B C
1 x y n
2 x y n
3 x y n
4 p q y
5 p q n
table2:
P A B C
1 x y y
2 p q y
i need to update the field C in table1 with the filed C in table 2
where table1.A = table2.A and table1.B = table2.B.
the foll query is not working.
update table1 t1
set c=
(select t2.c
from table2 t2
where t1.A = t2.A
and t1.B = t2.B
)
where exists
(select t2.c
from table2 t2
where t1.A = t2.A
and t1.B = t2.B
)
pls help meCan you describe "not working" in more detail? Based on the test data that you've posted, there is nothing for the query to do, but it should do nothing quite nicely.
If you change the values of table1.c to 'X' or something like that, then re-run your query, it should put you right back where you started.
-PatP
I have the foll schema.
table1:
*P,A,B,C
table2:
*P,A,B,C
Consider the records in the table:
table1:
P A B C
1 x y n
2 x y n
3 x y n
4 p q y
5 p q n
table2:
P A B C
1 x y y
2 p q y
i need to update the field C in table1 with the filed C in table 2
where table1.A = table2.A and table1.B = table2.B.
the foll query is not working.
update table1 t1
set c=
(select t2.c
from table2 t2
where t1.A = t2.A
and t1.B = t2.B
)
where exists
(select t2.c
from table2 t2
where t1.A = t2.A
and t1.B = t2.B
)
pls help meCan you describe "not working" in more detail? Based on the test data that you've posted, there is nothing for the query to do, but it should do nothing quite nicely.
If you change the values of table1.c to 'X' or something like that, then re-run your query, it should put you right back where you started.
-PatP
Subscribe to:
Posts (Atom)