Difference between revisions of "MS SQL"

Jump to navigation Jump to search
17 bytes added ,  09:20, 19 September 2013
Re-ordered sections
m (→‎Commands: Minor update)
(Re-ordered sections)
Line 92: Line 92:
#* File extension: <code>trn</code>
#* File extension: <code>trn</code>
#* File age:  Select as appropriate
#* File age:  Select as appropriate
== Commands ==
Crib sheet of some very basic stuff, the syntax isn't exactly the same, but see also [[MySQL]]
<source lang="sql">
SELECT * FROM MASTER..SYSDATABASES       /* Show databases */
EXEC sp_databases;                                                            /* Show databases */
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '%'       /* Show tables */
SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' /* Show base tables only (not views etc) */
</source>


== Gain Sysadmin Rights ==
== Gain Sysadmin Rights ==
Line 144: Line 134:
* No SQL services are running
* No SQL services are running
* No ''Microsoft SQL Server Management Studio'' instances are running (including via RDP, check for <code>Ssms.exe</code> or <code>Ssms.exe *32</code> in ''Task Manager''
* No ''Microsoft SQL Server Management Studio'' instances are running (including via RDP, check for <code>Ssms.exe</code> or <code>Ssms.exe *32</code> in ''Task Manager''
== Commands and Maintenance ==
Crib sheet of some very basic stuff, the syntax isn't exactly the same, but see also [[MySQL]]
<source lang="sql">
SELECT * FROM MASTER..SYSDATABASES       /* Show databases */
EXEC sp_databases;                                                            /* Show databases */
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '%'       /* Show tables */
SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' /* Show base tables only (not views etc) */
</source>


[[Category:Applications]]
[[Category:Applications]]
[[Category:Microsoft]]
[[Category:Microsoft]]

Navigation menu