How to assign a Schema to a particular SQL User

Answered How to assign a Schema to a particular SQL User

  • 2012년 8월 20일 월요일 오전 10:28
     
     

    Hi Team,

    How do i assign a schema to a particular user in SQL 2005 ?

    Could you please provide me the script or steps so that i can do manually.

    Thanks In Advance


    Sridhar D Naik

모든 응답

  • 2012년 8월 20일 월요일 오전 10:33
     
     제안된 답변
    • 답변으로 제안됨 Janos Berke 2012년 8월 20일 월요일 오전 10:46
    •  
  • 2012년 8월 20일 월요일 오전 10:47
     
     

    Hi,

    Do you want to assign the default schema to a user or want to give authorization over it?

    Janos


    There are 10 type of people. Those who understand binary and those who do not.

    My Blog | Hire Me

  • 2012년 8월 20일 월요일 오전 11:28
     
     

    Hi Janos,

    I want to assign a schema say "MyDB" to a user "MyUser" in SQL 2005.

    I dont know if the default schema is the the only DB present i.e., MyDB.

    Thank You.


    Sridhar D Naik

  • 2012년 8월 20일 월요일 오전 11:29
     
     

    Hi,

    Ok, what do you want to achieve?

    Janos


    There are 10 type of people. Those who understand binary and those who do not.

    My Blog | Hire Me

  • 2012년 8월 20일 월요일 오후 2:49
     
     

    Hi Janos,

    Let me explain you clearly.

    I did a Data Refresh from PROD DB to Lower Environment DB and one of the feature is not working now. I found that the schema associated with the user is pointing to PROD Schema after the Data Refresh.

    So,I just want to assign a Lower Environment schema to a user so that the feature affected would work fine.

    Thank You.


    Sridhar D Naik

  • 2012년 8월 20일 월요일 오후 9:22
     
     답변됨 코드 있음

    if you want to set the default schema of a user use the following code fragment

    ALTER USER UserName WITH DEFAULT_SCHEMA = NewSchemaName


    Please use Mark as Answer if my post solved your problem and use Vote As Helpful if a post was useful.