20. september 2004 - 11:39Der er
14 kommentarer og 1 løsning
hvordan opretter man brugere??
hjælp!! jeg har et problem. jeg ved ikke hvordan man opretter brugere. jeg har prøvet "create user knud" men det kan man ikke.. nogen der ved hvordan man gør det???
Is the name of the login. login is sysname, with no default.
[@passwd =] 'password'
Is the login password. password is sysname, with a default of NULL. After sp_addlogin has been executed, the password is encrypted and stored in the system tables.
Security Note Do not use a blank password. Use a strong password. For more information, see Security Rules.
[@defdb =] 'database'
Is the default database of the login (the database the login is connected to after logging in). database is sysname, with a default of master.
[@deflanguage =] 'language'
Is the default language assigned when a user logs on to SQL Server. language is sysname, with a default of NULL. If language is not specified, language is set to the server's current default language (defined by the sp_configure configuration variable default language). Changing the server's default language does not change the default language for existing logins. language remains the same as the default language used when the login was added.
[@sid =] sid
Is the security identification number (SID). sid is varbinary(16), with a default of NULL. If sid is NULL, the system generates a SID for the new login. Despite the use of a varbinary data type, values other than NULL must be exactly 16 bytes in length, and must not already exist. SID is useful, for example, when you are scripting or moving SQL Server logins from one server to another and you want the logins to have the same SID between servers.
[@encryptopt =] 'encryption_option'
Specifies whether the password is encrypted when stored in the system tables. encryption_option is varchar(20), and can be one of these values.
Value Description NULL The password is encrypted. This is the default. skip_encryption The password is already encrypted. SQL Server should store the value without re-encrypting it. skip_encryption_old The supplied password was encrypted by a previous version of SQL Server. SQL Server should store the value without re-encrypting it. This option is provided for upgrade purposes only.
sp_grantdbaccess Adds a security account in the current database for a Microsoft® SQL Server™ login or Microsoft Windows NT® user or group, and enables it to be granted permissions to perform activities in the database.
Is the name of the login for the new security account in the current database. Windows NT groups and users must be qualified with a Windows NT domain name in the form Domain\User, for example LONDON\Joeb. The login cannot already be aliased to an account in the database. login is sysname, with no default.
[@name_in_db =] 'name_in_db' [OUTPUT]
Is the name for the account in the database. name_in_db is an OUTPUT variable with a data type of sysname, and a default of NULL. If not specified, login is used. If specified as an OUTPUT variable with a value of NULL, @name_in_db is set to login. name_in_db must not already exist in the current database.
Det er klippet fra books online med syntaxen for de to stored procedures, du skal bruge for at oprette login og give dette login adgang til en database.
okai.. ikke lige det jeg ledte efter men okai.. jeg skal bare have fundet ud af hvordan jeg opretter en bruger via query analyser. eller om man overhovedet kan gøre det.
og jeg ville nok også læse om application roles. Det er en god måde at få lavet rettighederne på, så det kun er bestemte brugere, af bestemte applicationer, der kan lave noget på sql serveren.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.