Bookmark and Share
MS SQL Server DBA
Display: 1 - 10 of 17, Total Pages: 2
1 2 > >>
[Work Notes] How to detect a SQL Server database's read only status [Original] 2014-7-30 5:19pm
Query 1SELECT name, is_read_only FROM sys.databases GOQuery 2SELECT name, is_read_only FROM sys.databases WHERE name = 'MyDBName'GOQuery 3EXEC sp_dboption "MyDBName", "read only"

Read Full Article...

Section:MS SQL Server DBA | Read:1109 | Comment:0 | Rating:0%

[Work Notes] How to find SQL instance name, server name, DB status [Original] 2014-7-30 4:31pm
1. find instance name and server nameSELECT            SERVERPROPERTY('MachineName') AS [ServerName],         SERVE..

Read Full Article...

Section:MS SQL Server DBA | Read:635 | Comment:0 | Rating:0%

[Work Notes] How to find SQL Server Cluster Nodes and Shared Drives [Original] 2014-7-30 4:19pm
1. Find name of the Node on which SQL Server Instance is Currently running   SELECT SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS [CurrentNodeName] ++ If the server is not cluster, then t..

Read Full Article...

Section:MS SQL Server DBA | Read:489 | Comment:0 | Rating:0%

[Work Notes] How to check SQL DB backup history [Original] 2014-7-30 4:15pm
Query 1SELECT s.database_name, s.server_name, s.machine_name,max(s.backup_start_date) as dateFROM msdb.dbo.backupset sgroup by s.database_name,s.server_name, s.machine_nameorder by dateQuery 2SELECT s..

Read Full Article...

Section:MS SQL Server DBA | Read:880 | Comment:0 | Rating:0%

[Work Notes] find fragments in indexes and optimize the indexes [Original] 2014-6-16 2:45pm
-- Be careful of executing it against large production system without detailed filteringUSE wwdev03;GOSELECT OBJECT_NAME(ips.object_id) AS Objectname,    i.name AS IndexName,  ..

Read Full Article...

Section:MS SQL Server DBA | Read:480 | Comment:0 | Rating:0%

[Work Notes] Grant privileges and Execute queries [Original] 2014-6-4 4:00pm
--change the execution context to a specific USERGRANT SELECT ON DBschema.product to MyLogin;GOEXECUTE AS USER = 'MyLogin';GOThe following query is ok.SELECT * FROM DBschema.product;GO The follow..

Read Full Article...

Section:MS SQL Server DBA | Read:711 | Comment:0 | Rating:0%

[Work Notes] Server and database roles [Original] 2014-6-2 3:33pm
-- ADD a login to the serveradmin roleEXEC sp_addsrvrolemember mylogin, serveradmin;GO-- view the members of the server rolesuse master;GOSELECT r.name AS RoleName, p.name AS PrincipalNameFROM sys.ser..

Read Full Article...

Section:MS SQL Server DBA | Read:472 | Comment:0 | Rating:0%

[Work Notes] restore a DB STOPAT Option [Original] 2014-5-29 11:42am
Restore a db by following the following restore sequence:RESTORE DATABASE database_name FROM full_backupWITH NORECOVERY;RESTORE DATABASE database_name FROM differential_backupWITH NORECOVERY;RESTORE L..

Read Full Article...

Section:MS SQL Server DBA | Read:489 | Comment:0 | Rating:0%

[Work Notes] Change a SQL DB to read-only / read-write [Original] 2014-5-29 11:29am
-- Make Database Read OnlyUSE [master]GOALTER DATABASE [DBNAME] SET READ_ONLY WITH NO_WAITGO-- Make Database Read/WriteUSE [master]GOALTER DATABASE [DBNAME] SET READ_WRITE WITH NO_WAITGO -- Make Data..

Read Full Article...

Section:MS SQL Server DBA | Read:576 | Comment:0 | Rating:0%

[Work Notes] Recovering an offline database step by step [Original] 2014-5-28 4:57pm
Recovering an offline database step by step-- check the database state to see RECOVERY_PENDING;    SELECT name, state_desc     FROM sys.databases WHERE name='Marketdev';&..

Read Full Article...

Section:MS SQL Server DBA | Read:507 | Comment:0 | Rating:0%

1 2 > >>
Latest Comments
eozzrixrlo

on line..
- By admin, 2008-4-24 2:34am
rvaqlckrdu

free nud..
- By admin, 2008-4-24 2:33am
xndfjmwcpj

- By admin, 2008-4-5 1:02pm
vsjblsgatm

somali p..
- By admin, 2008-4-5 1:01pm
jknsdsmvyi

- By admin, 2008-3-12 1:48am
fkgyuchizk

tramadol..
- By admin, 2008-3-12 1:48am
wnniqpohsg

- By admin, 2008-4-24 2:32am
unxnmahoya

in phent..
- By admin, 2008-4-24 2:29am
bkgulrjbtt

- By admin, 2008-3-12 1:47am