A collection of code that I run on a semi-regular basis to troubleshoot or get an overal status of machines and or code. Most of these will be for SQL Server and Powershell
- Concatenate values as comma delimited list
- Getting file size, space used and space free information for a SQL Server database
- How much longer will the database restore take
- List all tables that are truly partitioned
- List all tables with identity columns
- Listing all RESTORE and BACKUP operations currently going on your SQL Server
- Renaming a Table
- Return a range of dates minus weekends and holidays
- Return all stored procedures that contain certain text
- Return columns for a user defined table type
- Returning a value inserted in a table with a newsequentialid() default on a uniqueidentifier column
- Running count with windowing functions
- Index Fragmentation
- Who is connected to my server
- When were the databases backed up?
- What is currently running on the server
- Using sp_send_dbmail to email query result
- List the existing Extended Events sessions
- Simple Extended Event Session to check when procs were called