Showing entries 1 to 2
Displaying posts with tag: SQL DBA (reset)
Script all the jobs in SQL Server

This is very interesting fact that people always look for shortcuts especially while accomplishing the big tasks.

Here i have came up with a scenario: I have got a task to setup a new server B (lets assume) exactly as a replica of Existing Server A.

It involve a lot of steps in which there is a step to copy all the EXISTING JOBS FROM SERVER A to SERVER B (Please note i have written All the Jobs).

 Here is a easiest way i have found which might be helpful for many people.

Step1: Enable Object explorer detail.

Step2:
In SQL Server 2005 or earlier:  goto view->Summary
In SQL Server 2008 or older:  goto view-> Object Explorer Details

Step3:
Expand SQL Server Agent and click on Jobs.

All the jobs will be visible in summary/Object Explorer Detail …

[Read more]
Database is in Transition. try the statement later: SQL Server

Problem:

I was trying to take the database offline to perform some maintenance on one of our QA server.

We have got a strange error "Database is in Transition. try the statement later Error 952"

Even i was not able to run the sp_who and sp_who2 also as it was also giving the same error.


Resolution:  What i have tried?

I closed the SSMS (SQL Server Management Studio) and restarted it again.

Then to confirm and check for any blocking query, i ran sp_who and sp_who2 and it ran successfully.

 Then to make Database offline/online i have used the below command and it worked like a charm :)

USE master
GO

ALTER DATABASE <db_name>

SET OFFLINE WITH ROLLBACK IMMEDIATE ... ... ALTER DATABASE <db_name> SET ONLINE

[Read more]
Showing entries 1 to 2