Wednesday, March 7, 2012

create login

i need to make the following instructions (the name used are for example different than the database that im working)

Create new database 'Company'. Add new login (e.g. 'test_login') for 'Company' with password (e.g. '12345').
Create new user (e.g. 'test_user') for login 'test_login'. Set 'Database role' of user 'test_user' in 'Company' to 'db_owner'.
Create new schema (e.g. 'test_schema'). Set 'Default schema' of 'test_user' in 'Company' to 'test_schema'.
Input sql script 'Company.sql' as login 'test_login' to populate 'Company'.

im looking in the tutorial and for the moment i have this

CREATE LOGIN logs1 WITH PASSWORD = '12345'
CREATE USER luis FOR LOGIN logs1
WITH DEFAULT_SCHEMA;
GO

but i want to make all the steps.

Have a look in books on-line - it should be easy to find the instructions you need.

e.g. search for create database, roles,

|||i had previusly created the database with all the tables and data, then how can i create a schema for that and the functions that I found to set 'Database Role' are for Java, J#, C, etc, not for T-sql
|||

In books on-line filter the results by the database engine and you should get the t-sql help.

Look for create schema and create role.

You can also look for sp_addrole (the v2000 command) and it should link to the create role command.

You can also google "sql server create schema" but you need to know the command to do that

I'm not being awkward - you seem to be able to cope just have a problem with books on-line and you will get a lot more out of that rather than being told the code to write.

No comments:

Post a Comment