I've moved a database from sql 2000 to a new 2005 server. Everything was fine until I logged into Sql Server Management studio with one particular user. It looks like i logged in successfully but when I try to expand the database I get 'The database is not accessible'. I can log in with windows authentication and with other sql users with no problem and can see everything.
I checked and made sure the DB is not in single user mode. I also checked for orphaned logins (exec sp_change_users_login 'report') and none were found.
Any help in pointing me in the right direction would be greatly appreciated.
check if the user has proper permissions to access the db.
Related
I've installed SQL Server Express 2019 on a Windows machine for Sitecore development. I had a hard drive crash and needed to rebuild; prior to the crash everything was working fine.
Mixed authentication is enabled, as is the SA account.
The Sitecore installer can connect to my local instance, and sets up the database structure, including a set of database logins. Everything looks OK in SSMS and initially works - I get the Welcome to Sitecore page.
However, connecting to SSMS and then trying to log in with the passwords Sitecore generated fails. When I try to set them in SQL Server, they don't take (I always get a bad password error).
I've tried as both my Windows account (which installed SQL Server) and as the sa account I configured at install. Also tried running as administrator.
The GUI and scripts seem to work fine, but the passwords never seem to get set. Prior to the crash I could connect to SSMS using the generated logins, and verify connectivity.
I'm at a loss where to go from here, other than imaging the machine and reinstalling a fresh copy of Windows.
I'm assuming that you had to reinstall SQL Server and then perform a database restore from a backup.
If this was the case, the users in the database, after the restore, were "orphaned", as they had no corresponding login in the master database. Even if Sitecore did create logins, they would have different SIDs to the users in the Sitecore database. The only way work with those users, would have been to restore a backup of the master database, in which case both server logins and database users would have had the same SIDs.
Failing that, your only option was to delete the users and re-create the logins and users correctly, which you did.
For future reference check out Microsoft's documentation on troubleshooting orphaned users in SQL Server.
So, no, this was not "a quirk with the installer and SQL Express or some kind of bug." ;-)
HTH Sean
I am trying to restored a .bak file on an Azure SQL server through SSMS.
The reason why I am doing this is that my company unfortunately blocked any action on the Azure portal itself and therefore I have to find another way around.
I am able to connect successfully to the DB on Azure with my admin account through SSMS.
I first successfully restored the .bak on my local database. And then I am trying:
Again, I am able to connect through the same SSMS to the SQL db.
Moreover, when starting this procedure I get asked to connect first to the DB, which works successfully! What I mean is:
It doesn't give me any error, which is weird because if I try to connect with a wrong password it tells me right away that is wrong. So it kind of accepts it. It's only after when I really start the deployment that it gives me the problem:
Just for now, Azure SQL database doesn't support restore from .bak file.
You work flow should be right, restore the .bak file(database) into a local SQL Server firstly, then deploy the restored database to Azure with "Deploy database to Microsoft Azure SQL database".
Make sure you are using the server admin account of the Azure SQL database. Per my experience, the error is usually caused by the permission limits.
If all of these(SSMS) don't work, please thy other ways. Please try Data Migration Assistant(DMA) migrate the database. If DMA still give the same error, we can ensure that it's not caused by the tools, you need another higher Azure SQL database account permission.
HTH.
Working solution was to use the export data task:
For some reason this worked and the publish to ASQL task from SSMS didn't. I understand this is very based on the restrictions imposed by my company but at least this solution worked.
NOTE: as both Source and Destination use SQL Server Native Client .
Moreover when setting the Destination the refresh of the list of databases might not work (depending on your permissions on Server level) but if you type directly the name of the database it will work. Talking about this:
So I am completely new to .Net Core development, and was given a codebase that I am trying to host on Microsoft Azure. I have the local database file (.mdf) in SQL Server Management Studio, and am trying to deploy it to an Azure Database, However it keeps failing during migration and giving me this issue
Error SQL71627: The element User: [ISOCENTRIC\Administrator] has property >AuthenticationType set to a value that is not supported in Microsoft Azure SQL >Database v12.
(Microsoft.SqlServer.Dac)
However, when I SELECT * FROM master.sys.database_principals; and it dumps the db users list, the "ISOCENTRIC\Administrator" user does not appear in that list, so I cannot find a way to drop it from the DB. Is there something I am missing regarding the location of this user and how I can drop it from the db so I can migrate to Azure?
p.s. This is my first post on here so please let me know if I should make any changes to adhere to correct formatting on this forum.
Thanks in advance.
I guess the database users can't be migrated to Azure SQL DB because they are Windows users. You'll need to drop those users before you deploy this database to Azure SQL DB.
You can always backup and restore a copy of this database, remove the users, and then deploy that one to Azure SQL Db.
I figured out that my query to dump the database users was incorrect, and was able to find and drop the user causing the issue.
I created a server on Microsoft Azure, and a SQL database on it. I downloaded SQL Server Management Studio, and I am able to connect to the server fine using the Server Admin Id and password I created when creating the server. But when I try and run a bulk load query to insert a picture in a picture column. It says I do not have rights. Error is:
You do not have permission to use the bulk load statement
Also in Management studio if I go to server level security folder I have logins as an option and the Server Admin ID is there, when I right click to go to properties, its missing properties as an option.
Let me know if you need more info.
Any help is appreciated,
Thank you,
Abdul
As part of the way we handle support for our clients for an enterprise application, we have them backup their database, I restore it on our server, do some maintenance, backup it up, and have them restore it on their server. This works very well, but I usually have to reset the users permissions for that database. But at the moment I have one client that is not able to run the DTS packages on that server due to a database user not being able to connect to the database. I've tried looking through every possible setting and option as well as checked and rechecked the permissions for that user, who by the way is in the dbo role, but nothing seems to work. Anyone know why I can't connect even though the user has the correct permissions?
Thanks in advance!
The owner of the database might be wrong. I'd check that first by making sure the owner is set to a user or role on their network (or sa if they're not using Windows authentication).