{"id":534,"date":"2009-06-06T20:03:00","date_gmt":"2009-06-06T20:03:00","guid":{"rendered":"\/blogs\/kimberly\/post\/Favorite-SSMS-Options-and-some-gotchas.aspx"},"modified":"2013-01-11T23:11:25","modified_gmt":"2013-01-12T07:11:25","slug":"favorite-ssms-options-and-some-gotchas","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/favorite-ssms-options-and-some-gotchas\/","title":{"rendered":"Favorite SSMS Options &#8211; and some gotchas"},"content":{"rendered":"<p>\nWhenever I setup a new machine, I like to set a few default options in SSMS. Here are my favorites:\n<\/p>\n<p>\n<strong>Tools, Options<\/strong>\n<\/p>\n<ul>\n<li>\n<div>\n\tEnvironment\n\t<\/div>\n<ul>\n<li>\n<div>\n\t\tFonts and Colors\n\t\t<\/div>\n<ul>\n<li>\n<div>\n\t\t\tText Editor font: Lucida Console (<em>a bit thicker and it&#39;s a fixed-width font<\/em>)\n\t\t\t<\/div>\n<\/li>\n<li>\n<div>\n\t\t\tText Editor: Selected Text (under display items)\n\t\t\t<\/div>\n<ul>\n<li>\n<div>\n\t\t\t\tItem foreground: Black\n\t\t\t\t<\/div>\n<\/li>\n<li>\n<div>\n\t\t\t\tItem background: Yellow (looks like a highlighter)\n\t\t\t\t<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<div>\n\t\t\tSometimes I&#39;ll also make the results windows have larger fonts &#8211; especially if it&#39;s a presentation machine\n\t\t\t<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<div>\n\t\tKeyboard\n\t\t<\/div>\n<ul>\n<li>\n<div>\n\t\t\tKeyboard scheme: SQL Server 2000 (<em>ok, maybe&nbsp;I&#39;m old-school but the QA keyboard shortcuts still&nbsp;seem a lot more natural than the VS keyboard shortcuts&#8230; but, if you&#39;re more of a VS person, then&nbsp;stick with Standard<\/em>)\n\t\t\t<\/div>\n<\/li>\n<li>\n<div>\n\t\t\tQuery shortcuts:\n\t\t\t<\/div>\n<ul>\n<li>\n<div>\n\t\t\t\tCtrl+F1: <a href=\"https:\/\/www.sqlskills.com\/blogs\/kimberly\/updates-fixes-to-sp_helpindex2\/\" target=\"_blank\">sp_helpindex2<\/a>&nbsp;(<em>if you highlight an object and then hit Ctrl+F1, then it passes the highlighted object in as a parameter. The only negative is that it doesn&#39;t delimit it so you can&#39;t highlight schema.object unless it&#39;s already quoted for the sp &#39;schema.object&#39;<\/em>)\n\t\t\t\t<\/div>\n<\/li>\n<li>\n<div>\n\t\t\t\t<font size=\"+0\">Ctrl+3: <font face=\"courier new,courier\">SELECT object_name(object_id) AS ObjName, * FROM sys.dm_db_index_physical_stats(db_id(), NULL, NULL, NULL, NULL) ORDER BY 1, 4\n\t\t\t\t<\/div>\n<\/li>\n<li>\n<div>\n\t\t\t\tCtrl+4: other common queries\/procedures&#8230;\n\t\t\t\t<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<div>\n\tText Editor\n\t<\/div>\n<ul>\n<li>\n<div>\n\t\tAll Languages\n\t\t<\/div>\n<ul>\n<li>\n<div>\n\t\t\tLine numbers\n\t\t\t<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<div>\n\t\tEditor Tab and Status Bar &#8211; I usually change the colors of the &quot;Group connections&quot; setting to something very noticeable like Fuschia. I&#39;ve already blogged why <a href=\"https:\/\/www.sqlskills.com\/blogs\/kimberly\/sql-server-2008-central-management-servers-have-you-seen-these\/\" target=\"_blank\">here<\/a>.\n\t\t<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<div>\n\tQuery Execution\n\t<\/div>\n<ul>\n<li>\n<div>\n\t\tBy default, open new queries in SQLCMD mode (<em>however, if you set this &#8211; you will disable Intellisense and Transact-SQL Debugging&#8230; and, there&#39;s no &quot;hint&quot; or warning that you&#39;re doing it.<\/em>)\n\t\t<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<div>\n\tQuery Results\n\t<\/div>\n<ul>\n<li>\n<div>\n\t\tSQL Server, Results to Grid\n\t\t<\/div>\n<ul>\n<li>\n<div>\n\t\t\tInclude the query in the result set (<em>this will show you what you executed in the results window while you wait for completion&#8230; also confirms what you think you executed. This gets annoying for large batches but is sometimes useful to see what you last executed<\/em>)\n\t\t\t<\/div>\n<\/li>\n<li>\n<div>\n\t\t\tInclude column headers when copying or saving the results (<em>VERY useful if you&#39;re pushing data over to Excel, etc.<\/em>)\n\t\t\t<\/div>\n<\/li>\n<li>\n<div>\n\t\t\tDisplay results in a separate tab (<em>this gives you Tabbed mode instead of split-window mode meaning that results will go to a results Tab instead of the lower half of your window. I prefer this when I have a lot of results to review AND when I&#39;m presenting and typically run with a lower screen res.<\/em>)\n\t\t\t<\/div>\n<ul>\n<li>\n<div>\n\t\t\t\tSwitch to results tab after the query executes (I prefer this so that I&#39;m waiting for the results in the results window)\n\t\t\t\t<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<div>\n\t\tSQL Server, Results to Text\n\t\t<\/div>\n<ul>\n<li>\n<div>\n\t\t\tI set most of the same settings as Results to Grid (Include column headers, Include the query, Display results in separate tab and Switch to the results tab) BUT, I usually turn off Scroll results as received. If I&#39;m looking at rows at the top of the set (while it&#39;s still processing) it often takes my cursor down to the end. I also turn this off in Profiler.\n\t\t\t<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\nThe primary reason for this post though &#8211; is to make sure that you realize that one specific option &#8211; Tools, Options, Query Execution, &quot;By default, open new queries in SQLCMD mode&quot; &#8211; can really surprise you. I used to think that this option was really helpful (and benign) because SQLCMD is a superset of Transact-SQL. So, I typically recommended that you turn it on. However, turning on this option disables Intellisense and the Transact-SQL Debugger. It&#39;s documented here: <a href=\"http:\/\/msdn.microsoft.com\/Areas\/Epx\/Content\/500.htm?aspxerrorpath=\/en-us\/library\/ms174187.aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/ms174187.aspx<\/a>&nbsp;(thanks Paul Mestemaker! :) and I thought this was a bit unintuitive at first but it really does make sense. Both the Transact-SQL Debugger and Intellisense are debugging and\/or prompting you with Transact-SQL (not SQLCMD commands). So, disabling it seems right (well, I guess I could argue that it could work with Intellisense but debugging would be much harder). However, I just wish there were some better information in the Tools\/Options dialog. I&#39;d like my 2 hours back (trying to figure out which option disabled Intellisense, chatting with my friends on fb to see if they knew, filing a connect bug when I figured out that it was SQLCMD, and then learning from Paul Mest that it&#39;s actually expected behavior (duh!), changing the Connect bug to say that the dialog might be better with a warning&#8230; it was definitely one of those mornings!&nbsp;&nbsp;:) :) :)\n<\/p>\n<p>\nSo, my main point for this post &#8211; save you the time I lost in trying to figure out where Intellisense went. It&#39;s expected behavior (and it does make sense&#8230;&#8230;..now :).\n<\/p>\n<p>\nCheers,<br \/>\nkt<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Whenever I setup a new machine, I like to set a few default options in SSMS. Here are my favorites: Tools, Options Environment Fonts and Colors Text Editor font: Lucida Console (a bit thicker and it&#39;s a fixed-width font) Text Editor: Selected Text (under display items) Item foreground: Black Item background: Yellow (looks like a [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43,79],"tags":[],"class_list":["post-534","post","type-post","status-publish","format-standard","hentry","category-manageability","category-tools"],"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/posts\/534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/comments?post=534"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/posts\/534\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/media?parent=534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/categories?post=534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/kimberly\/wp-json\/wp\/v2\/tags?post=534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}