I showed how easy it is to create a snippet in a previous blog and said I would share my snippets file. These are the current SQL snippets
sqlblocking – List blocked processes order by head blocking processes
sqlschema – List the schema in the current database
sqlGetIndexStats – Lists the current index statistics, read, writes, seeks, scans, etc.
sqlGetTableSizes – Show the table sizes and row sizes
sqlcolumnListSameLine -Generate a list of columns comma-separated on the same line, in column order
sqlcolumnListOrderbyName Generate list of columns comma separated by name
sqldatabasesizes – list of data and log sizes and combined free space
sqlfindcolumns List columns in all tables whose name is like ‘TableName’
sqljobsteps – All the jobs enabled, ordered by step_id and also a blank line in for readability!
sqlstartstep – Code to start a job at a specific step
sqltablesizes – list current database sizes and rows
sqlWhoisactive – Adam Mechanic Whoisactive but with a twist ( its a temporary procedure so can use on servers that don’t have it)
If you want to try these yourself rather than link each file you can download my sql.json file.
Browse to your settings folder replacing the your login bit. backup your sql.json and copy in the one from above.
C:\Users\yourlogin\AppData\Roaming\azuredatastudio\User
Go into Azure Data Studio and type in sql…. and one of the selections above, feel free to use to your heart’s content.
I will maintain the settings.json from time to time but if you have any you think would be useful feel free to contact me and I’ll add them in.