question

lin-0948 avatar image
0 Votes"
lin-0948 asked CarrinWu-MSFT commented

Sync Login from MSSQL to Azure

Prior DB migration from MSSQL to Azure, I tried to sync login by using script as below CREATE LOGIN [username] WITH PASSWORD = 'password', SID = 0xxxxxxxxxxxx However I got this error : Specified SID is invalid for this version of SQL Server. Is there anyway i can create login with same SID so I no need regrant access since there is DB user mapping after migrate DB to azure?

azure-sql-databasesql-server-migration
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @lin-0948, we have not get a reply from you. Did the answers could help you? If there has an answer helped, do "Accept Answer". If it is not work, please let us know the progress. By doing so, it will benefit all community members who are having this similar issue. Your contribution is highly appreciated.

0 Votes 0 ·
KalyanChanumolu-MSFT avatar image
0 Votes"
KalyanChanumolu-MSFT answered KalyanChanumolu-MSFT edited

@lin-0948 Welcome to Microsoft Q&A forums.

If you are using Azure Database Migration Service, you can easily migrate the logins using a graphical user interface.

If you want to migrate logins using a TSQL script, please use MoveLogin.ps1 to generate it.
The tool allows the automatic mapping of Windows AD accounts to Azure AD accounts or it can do UPN lookups for each login against the on-premise Windows Active Directory.


If an answer is helpful, please "Accept answer" or "Up-Vote" for the same which might be beneficial to other community members reading this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

CarrinWu-MSFT avatar image
0 Votes"
CarrinWu-MSFT answered CarrinWu-MSFT edited

Hi @lin-0948,

The SID is not possible to transfer between OnPremise environment to Azure SQL Database. You will get the error message if you execute the T-SQL. Please refer to Lesson Learned #35: How to transfer the login and user from OnPremise to Azure SQL Database to get more information.

You can move SQL logins from the source SQL Server to Azure SQL Database using Database Migration Service (DMS) in offline mode. Use the Selected logins blade in the Migration Wizard to migrate logins to your target SQL Database. Please refer to Logins and groups to get more information.


Best regards,
Carrin


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.