Viewing 8 posts - 1 through 8 (of 8 total)
Why not ?
USE master
go
ALTER DATABASE <your database name> SET OFFLINE WITH ROLLBACK IMMEDIATE
go
ALTER DATABASE <your database name> SET ONLINE
go
August 27, 2015 at 6:51 am
--Try this query
;WITH XMLNAMESPACES (
DEFAULT 'http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition',
'http://schemas.microsoft.com/SQLServer/reporting/reportdesigner' AS rd
)
SELECT
name,
path,
x.value('CommandType[1]', 'VARCHAR(50)') AS CommandType,
x.value('CommandText[1]','VARCHAR(MAX)') AS CommandText,
x.value('DataSourceName[1]','VARCHAR(50)') AS DataSource
FROM (
select name, path,
CAST(CAST(content AS VARBINARY(MAX)) AS XML)...
February 20, 2014 at 1:51 pm
Using hand crafted scripts is all well and good, however you should enclose the database name in [ ] to avoid databases containing a space in their names; otherwise your...
December 17, 2012 at 9:12 am
Hi,
See if this is something along your lines of DBA information/metadata also.
You may be able to use/share the code.
Oliver
November 25, 2011 at 6:49 am
Why not use this script to get the latest backups ...
SELECT DatabaseName=a.database_name, BackupDate=a.backup_date,
PhysicalDeviceName=physical_device_name,
BackupSize=backup_size,
Duration=duration
FROM
(SELECT sd.name AS database_name,
MAX(bs.backup_finish_date) AS backup_date
FROM master.dbo.sysdatabases sd
LEFT OUTER JOIN msdb.dbo.backupset bs ON...
August 22, 2011 at 6:43 am
--Kill all users instantly
use master
go
alter database test set offline with rollback immediate
go
alter database test set online
go
May 19, 2011 at 6:54 am
--Last day of the current month.
--You could format it and it also takes into account the timestamp - 3 milliseconds
SELECT DATEADD(MS,-3,DATEADD(MM, DATEDIFF(M,0,GETDATE() )+1, 0))
May 19, 2011 at 6:50 am
Have you created the new "cluster disk" as a physical resource in the cluster administrator?
May 8, 2007 at 8:37 am
Viewing 8 posts - 1 through 8 (of 8 total)