Showing posts with label scope. Show all posts
Showing posts with label scope. Show all posts

Monday, March 26, 2012

ON SCHEMA :: schema_name

Hi,

Could you explain what a scope qualifier is (the two "::" colons) and what it is used for?

Thanks.It is used to scope permissions to a particular object: I.e. GRANT ALTER ON SCHEMA::mySchema to nielsb gives the user nielsb rights to create tables etc in that schema. This is not limited to only schemas, but are used for almost all database objects.
Niels|||Thank you Niels!|||

SQL 2K5

This :: syntax is covered in the BOL topic for the GRANT, DENY, and REVOKE statements.

To elaborate on Niels's post, you need ALTER permission on a schema and CREATE TABLE permission to create a table.

Also - note that ALTER permission on a container like a schema or database gives the grantee the ability to DROP contained objects as well. So if I give you ALTER permission on schema S, then you can DROP tables (or procs or views or ...) in S.

sql

Saturday, February 25, 2012

Ole Automation procedures. DB scope?

I have been looking at the OLE automation procs (ex. sp_OACreate, etc. ) and
am wondering about their scope. Does the OLE process have scope on the
executing transaction? Or must the OLE object establish its own database
connection? For example, I have an example using 'SQLDMO.SQLServer' and it
establishes its own database connection, so some of its parameters are
instance, login name, and PW.
We have several db instances and databases and we move procs around quite
often and I don't want to have to worry about passing db connection info.
Thanks,
MichaelHi
there is no scope in SQL Server 2000. In SQL Server 2005, CLR objects have a
scope.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Snake" wrote:

> I have been looking at the OLE automation procs (ex. sp_OACreate, etc. ) a
nd
> am wondering about their scope. Does the OLE process have scope on the
> executing transaction? Or must the OLE object establish its own database
> connection? For example, I have an example using 'SQLDMO.SQLServer' and i
t
> establishes its own database connection, so some of its parameters are
> instance, login name, and PW.
> We have several db instances and databases and we move procs around quite
> often and I don't want to have to worry about passing db connection info.
> Thanks,
> Michael|||Mike,
I am not sure if you answered my questions in a way that I can understand.
Can you give me a little more detail?
Thanks,
Michael
"Mike Epprecht (SQL MVP)" wrote:
> Hi
> there is no scope in SQL Server 2000. In SQL Server 2005, CLR objects have
a
> scope.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
>
> "Snake" wrote:
>