When using the below script all databases will be updated. The output may not be very beautiful, but the effect is amazing.
MSSQL Recover users after restore
Save the below script into a stored procedure, and you can call this after restoring a database, but you can also just copy this into a query. Don’t forget that the query should be using […]
Insert huge SQL script
http://www.diaryofaninja.com/blog/2009/09/25/running-large-mssql-scripts-amp–resulting-memory-errors It took time to get it to work, I went through the same headaches, but finally got it running with below command, including a login. https://docs.microsoft.com/en-us/sql/tools/sqlcmd-utility sqlcmd -S YOURSQLSERVER\INSTANCENAME -i “C:\Your Script.sql” sqlcmd -a […]
Database in restoring mode
If the database is stuck in restoring mode, all that is needed should be to run this command RESTORE DATABASE <database> WITH RECOVERY