How many times have you written a join with a bunch of tables and you wanted to quickly see what was in a table. You would either find the table in object explorer, right click and click on SELECT top 1000 rows
This would produce something like the following
/****** Script for SelectTopNRows command from SSMS ******/ SELECT TOP 1000 [lastrun] ,[cpu_busy] ,[io_busy] ,[idle] ,[pack_received] ,[pack_sent] ,[connections] ,[pack_errors] ,[total_read] ,[total_write] ,[total_errors] FROM [master].[dbo].[spt_monitor]
Make sure you have a trailing space after from
Hit OK, now restart SSMS because it won't take effect right away
Once you have restarted SSMS and have connected to a database, in a new query window type any table name that you want, for example if you are in the master database type spt_values, double click on the table name so that it is highlighted, now press CTRL + 5 and voila you should see 100 rows from this table....
Now you can just click on any table or view and see the 100 rows, this way you can easy see what the table looks like
You can also do this with sp_helptext, here is how you do it, add sp_helptext where CTRL + 6 is, make sure you have a trailing space after the proc name
Restart SSMS again, type a proc name, double click on the name, hit CTRL + 6 and you should see the definition in the output
There you have it..some time saver shortcuts. You can also do this with other queries and procs...what are some of your favorite shortcuts?
No comments:
Post a Comment