LOGINS SQL SERVER 2005 SP2 ENTERPRISE EDITION

  • Hi, I'm not understandig well the new way of creating logins on sql server 2005.

    Reading on books online it recomends to create logins using Create Login... to add a new Login, better than sp_addlogin.

    Then I use create login but on 2005 we need to especify a schema, I want all my new users use dbo but when I create them they have their own schema like this

    Create Login user1 with password = '123'

    And his schema is user1, how can I specify dbo schema using t-sql?

    Another question is how can I create new logins like 001dev, with numeric values at the beginning, I can't use create login '001dev' or create login '''001dev''' because a sintax error is displayed

    Thanks for any help

  • A Login is a server object has no Schema. Only a database user has a default schema.

    SO

    Create Login user1 with password = '123xTYU'

    --Creates a login, but no database access

    USE MyDB

    CREATE USER user1 FOR LOGIN user1 WITH DEFAULT SCHEMA = dbo

    -- This creates the database user witj the default schema

    About the logins with a number upfront use this syntax

    Create Login [1user1] with password = '123xTYU'

    Markus

    [font="Verdana"]Markus Bohse[/font]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply