DECLARE @SQLString VARCHAR(7500)
SELECT@SQLString = ''
SELECT@SQLString = @SQLString + 'EXEC sp_Change_Users_Login ''UPDATE_ONE'','+QUOTENAME([Name],'''')+','+QUOTENAME([Name],'''')+'; '
WHEREIsSQLUser = 1
AND(SId IS NOT NULL AND SId <> 0x0)
ANDSUSER_SNAME(SId) IS NULL
ORDER BY [Name]
Have you ever wished that creating a backup on the fly was easier and quicker? Whether you do it with the GUI or with T-SQL, you still have to open up Management Studio, connect to the database, and go through the steps. You have to figure out ...
There are a lot of scripts out there that will allow you to use the msdb to auto-generate restore scripts, but what if you cannot access the msdb database. What is the easiest way to make sure I have the proper restore scripts on hand without relying on the msdb database?
One of the first things that should be done when managing SQL Server is to setup an appropriate backup plan in order to minimize any data loss in the event of a failure. Along with setting up a backup plan there are certain database configurations that need to be setup to ensure you are able to backup databases correctly. In this tip we will look at the different recovery models that SQL Server offers and how to choose a recovery model for your database.