Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)

  • RE: Kill all USer Sessions before starting to restore a Database

    Why not ?

    USE master

    go

    ALTER DATABASE <your database name> SET OFFLINE WITH ROLLBACK IMMEDIATE

    go

    ALTER DATABASE <your database name> SET ONLINE

    go

  • RE: Where does Reporting Services store reports?

    --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)...

  • RE: Backup All Databases

    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...

  • RE: Total Database Information At Your Fingertips Part - II

    Hi,

    See if this is something along your lines of DBA information/metadata also.

    You may be able to use/share the code.

    Oliver

  • RE: Find Latest Backup

    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...

  • RE: Kill all connection to database

    --Kill all users instantly

    use master

    go

    alter database test set offline with rollback immediate

    go

    alter database test set online

    go

  • RE: Find Last Day of the Month

    --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))

  • RE: Unable to see Cluster disk

    Have you created the new "cluster disk" as a physical resource in the cluster administrator?

Viewing 8 posts - 1 through 8 (of 8 total)