Aracılığıyla paylaş


Database Page, Project Designer

This page applies only to SQL Server Projects.

To access this page, with a SQL Server project node selected in Solution Explorer, from the Project menu, choose Properties. When the Project Designer appears, click the Database tab.

  • Connection String
    Enter a connection string by clicking the Browse button and selecting a data source connection using the New Database Reference dialog box. For more information, see Add/Modify Connection (Microsoft SQL Server).

  • Permission Level
    Select the permission level from the drop-down list to specify a set of code access permissions granted to the assembly when accessed by Microsoft SQL Server. The value can be Safe, External, or Unsafe; these values correspond to the SQL Server permission sets SAFE, EXTERNAL_ACCESS, and UNSAFE, respectively. Safe is the default.

    This setting corresponds to the PERMISSION_SET argument for the SQL Server CREATE ASSEMBLY command. For more information, see Create Assembly (Transact-SQL).

    Also see the table in "SQL Server Permission Sets," later in this topic.

  • Assembly Owner
    Specify the name of a user or role as owner of the assembly in this text box. This value must either be the name of a role of which the current user is a member, or the current user must have IMPERSONATE permission. If you do not specify Assembly Owner, ownership is given to the current user.

    This setting corresponds to the AUTHORIZATION owner_name argument for the SQL Server CREATE ASSEMBLY command. For more information, see Create Assembly (Transact-SQL).

SQL Server Permission Sets

The following table describes the permission sets specified by each permission level on the Database page. Permission sets are sets of code access permissions granted to the assembly when accessed by SQL Server.

Permission set

SAFE

EXTERNAL_ACCESS

UNSAFE

Code access security

Execute only

Execute + access to external resources

Unrestricted

Programming model restrictions

Yes

Yes

No restrictions

Verifiability requirement

Yes

Yes

No

Ability to call native code

No

No

Yes

SAFE (the default) is the most restrictive permission set. Code executed by an assembly with SAFE permissions cannot access external system resources such as files, the network, environment variables, or the registry.

EXTERNAL_ACCESS enables assemblies to access certain external system resources such as files, networks, environmental variables, and the registry.

UNSAFE enables assemblies unrestricted access to resources, both within and outside an instance of SQL Server. Code running from within an UNSAFE assembly can call unmanaged code.

For more information on these settings, see the PERMISSION_SET argument in Create Assembly (Transact-SQL) and the "SQL Server Permission Sets" section in SQL Server Programming and Host Protection Attributes.

See Also

Tasks

How to: Deploy SQL Server Project Items to a SQL Server

How to: Connect to a Database from Server Explorer

Concepts

SQL Server Projects

SQL Server Programming and Host Protection Attributes

Reference

Add/Modify Connection (Microsoft SQL Server)

Other Resources

Creating SQL Server 2005 Objects in Managed Code

Database Connections

Projects, User Interface Elements