Getting ENV: Environment Values
We can get the values of a ENV environment setting this way. Follow the PowerShell commands in the window below: Here is a…
Read MoreWe can get the values of a ENV environment setting this way. Follow the PowerShell commands in the window below: Here is a…
Read MoreDBCC activecursors [(spid)] DBCC addextendedproc (function_name, dll_name) DBCC addinstance (objectname, instancename) DBCC adduserobject (name) DBCC auditevent (eventclass, eventsubclass, success, loginname, rolename, dbusername, loginid)…
Read MoreReading the SQL Server Log file – and undocumented command
1 2 3 4 5 6 7 8 9 10 11 12 |
SELECT [Current LSN], [Operation], [Transaction ID], [Parent Transaction ID], [Begin Time], [Transaction Name], [Transaction SID], [Lock Information], [Description] FROM fn_dblog(NULL, NULL) WHERE [Operation] IN ('LOP_BEGIN_XACT', 'LOP_COMMIT_XACT', 'LOP_MODIFY_ROW', 'LOP_DELETE_ROWS', 'LOB_INSERT_ROWS') |
to get all the column, execute this:
1 2 3 |
SELECT TOP 100 * FROM fn_dblog(NULL, NULL) ORDER BY [Current LSN] DESC |
Here is a blog…
Read MoreHere is what to do when the tempDB log file runs out of space. You will not be able to run any sp_Who*…
Read More* Checkpoints commit all dirty pages to disk. Therefore the very last checkpoint is the true starting point for SQL Server to start…
Read MoreThis little -parameter is useful when you have PowerShell output that is delimited with a character. Below is an example using the Env…
Read MoreHere are a few SQL commands that you can use if you simply want to delete a database that is in “Recovering” or…
Read MoreThis is a DBCC command I learned from Brent Ozar’s Indexing video. To get statistics on an index, simply use:
1 |
DBCC SHOW_STATISTICS ('Person.Person', IX_Person_LastName_FirstName_MiddleName); |
Views –…
Read MoreHere is the SQL to display the last LSN applied to the database (think log-shipping)
1 2 3 4 5 |
SELECT redo_start_lsn FROM sys.master_files WHERE database_id = DB_ID('SecondaryDatabaseName') AND type = 0 |
Views – 2824
Read MorePlanned Relocation Procedure First, let’s get the information we will need to write the T-SQL script to alter the databases. Use the script…
Read More