|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: 2 days ago @ 11:58 PM
Points: 42,
Visits: 97
|
|
I need to restrict user which was achieved by grant and deny permissions using TSQL in sql server 2008 R2 successfully.
Now i need to update database,For know ,I am using backup/restore for updation of database. But when ever i did it ,User grant/Deny were needed to assign .
Is their any thing that i used to grant/deny permission and no need to assign then on every restore/backup ???
Kindly let me know
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Tuesday, March 26, 2013 8:41 AM
Points: 2,562,
Visits: 3,451
|
|
maida_rh (1/30/2013) I need to restrict user which was achieved by grant and deny permissions using TSQL in sql server 2008 R2 successfully.
Now i need to update database,For know ,I am using backup/restore for updation of database. But when ever i did it ,User grant/Deny were needed to assign .
Is their any thing that i used to grant/deny permission and no need to assign then on every restore/backup ???
Kindly let me know i think you are refering here orphan login fix . right ?
IF you are using same copy of database again and again, then restore the backup , do the login fix and then take the backup and use it everytime. if you are using different and latest backup copy then you have to do the login fix everytime.
-------Bhuvnesh---------- While 1 = 1 (Learning SQL....) Click to get fast response of your post
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: 2 days ago @ 11:58 PM
Points: 42,
Visits: 97
|
|
I am using sql server authentication and user i assigned permission also have login id and pass,I googled the term "orphan login and got this :
[url=http://www.fileformat.info/tip/microsoft/sql_orphan_user.htm][/url]
what do i need to do as i need the restore to commit the change to a single table structure + data . I tryed the import but got error:
Violation of primary key constraints 'userid' .can not insert duplicate key in object 'usertb'
Kindly let me know and thanks
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Tuesday, March 26, 2013 8:41 AM
Points: 2,562,
Visits: 3,451
|
|
maida_rh (1/31/2013)
what do i need to do as i need the restore to commit the change to a single table structure + data . I tryed the import but got error:
Violation of primary key constraints 'userid' .can not insert duplicate key in object 'usertb' How you are restoring ? through backup ?
-------Bhuvnesh---------- While 1 = 1 (Learning SQL....) Click to get fast response of your post
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: 2 days ago @ 11:58 PM
Points: 42,
Visits: 97
|
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Tuesday, March 26, 2013 8:41 AM
Points: 2,562,
Visits: 3,451
|
|
maida_rh (1/31/2013) yes,through backup file then how come PK violation ? restore backup do data copy of exact the content in backup , there cant be PK violation
-------Bhuvnesh---------- While 1 = 1 (Learning SQL....) Click to get fast response of your post
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: 2 days ago @ 11:58 PM
Points: 42,
Visits: 97
|
|
Pk_violation when i tried to import data from current updated source database to destination database.
How can I resolve orphan login as ,already assiged a login password to that user ????
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Tuesday, March 26, 2013 8:41 AM
Points: 2,562,
Visits: 3,451
|
|
maida_rh (1/31/2013) Pk_violation when i tried to import data from current updated source database to destination database. still you are not clear here , are you populating tables on destination side which already contain data then there is possibilty of PK violation. if possible(Be very very careful) that you can afford then truncate the table at dest. side and then populate them.
maida_rh (1/31/2013) How can I resolve orphan login as ,already assiged a login password to that user ????
ALTER AUTHORIZATION ON DATABASE::YourDatabaseName TO sa GO
see this http://msdn.microsoft.com/en-us/library/ms187359.aspx
-------Bhuvnesh---------- While 1 = 1 (Learning SQL....) Click to get fast response of your post
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: 2 days ago @ 11:58 PM
Points: 42,
Visits: 97
|
|
I tryed TRUNCATE on table but still the same error of PK violation during import/Export.
What does AuTHORIZATION do ?If I assigned to sa ?
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Tuesday, March 26, 2013 8:41 AM
Points: 2,562,
Visits: 3,451
|
|
maida_rh (1/31/2013) I tryed TRUNCATE on table but still the same error of PK violation during import/Export. So it means your source table contains duplicate data ? do you have same PK on source table too as you have on dest table ?
maida_rh (1/31/2013) What does AuTHORIZATION do ?If I assigned to sa ? See the link i posted above
-------Bhuvnesh---------- While 1 = 1 (Learning SQL....) Click to get fast response of your post
|
|
|
|