any script for getting server login role permissions in sql 2005

  • hi,

    I can transfer my database one server to another server.After I created logins by using "sp_help_revlogin"

    but i didnot get login roles .how can i get this roles any script is there.plz help me...

    Regards:

    Dastagiri.

  • lots and lots of script contributions here on the site:

    http://www.sqlservercentral.com/search/?q=script+roles

    also search fro "script permissions", lots of nice examples of that as well.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Yes, I wrote an article on this:

    Retrieving SQL Server Fixed Server Roles for Disaster Recovery

    K. Brian Kelley
    @kbriankelley

  • hi,

    I opened u r link and used script server roles code .its showing error at bellow code.

    WHILE @@FETCH_STATUS = 0

    BEGIN

    ????SET @SQLCmd = 'exec sp_addsrvrolemember ''' + @login + ''' , ''' + @RoleName + ''''

    ????PRINT @SQLCmd

    ????SET @Count = @Count + 1

    --------------------

    syntax error at set @sqlcmd

    I attached the error screen plz check it .

  • Are you using double quotes for your quoted identifiers? With default settings for connections, this should work just fine (as others have used it).

    K. Brian Kelley
    @kbriankelley

Viewing 5 posts - 1 through 4 (of 4 total)

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