I have a habit of using keyboard shortcuts now and then. In the SQL Server Management Studio I have some favorites like CTRL-N to open a new query window, F7 to get the Object Explorer Details window or CTRL-SHIFT-M to get the popup to fill out the parameters in a generated template.
If you don’t know what I’m talking about you can try the following: in the Object Explorer, right-click the Stored Procedures node under the Programmability node of one of your databases and choose New Stored Procedure. This will open the Create Procedure template in a new query window. It looks like this:
-- ================================================ -- Template generated from Template Explorer using: -- Create Procedure (New Menu).SQL -- -- Use the Specify Values for Template Parameters -- command (Ctrl-Shift-M) to fill in the parameter -- values below. -- -- This block of comments will not be included in -- the definition of the procedure. -- ================================================ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <Author,,Name> -- Create date: <Create Date,,> -- Description: <Description,,> -- ============================================= CREATE PROCEDURE <Procedure_Name, sysname, ProcedureName> -- Add the parameters for the stored procedure here <@Param1, sysname, @p1> <Datatype_For_Param1, , int> = <Default_Value_For_Param1, , 0>, <@Param2, sysname, @p2> <Datatype_For_Param2, , int> = <Default_Value_For_Param2, , 0> AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here SELECT <@Param1, sysname, @p1>, <@Param2, sysname, @p2> END GO
As you can see, it mentions the keyboard shortcut in the comments on top. Hitting CTRL-SHIFT-M opens the following popup:
In this popup you enter whatever values you’d like to fill in. When clicking OK, SSMS replaces the placeholders with the filled-in values.
So to cut to the chase, since I started using SSMS2008 I occasionally noticed that these keyboard shortcuts didn’t work anymore. At first I didn’t give it too much thought but when it started to really bug me I decided to check it out. And it appears to be a bug of some sort. There’s a really easy fix though.
Switching to the 2000 keyboard layout and switching back to 2008 will fix the problem. To switch keyboard layouts, go to Tools > Options. Under Environment > Keyboard you can select two different keyboard schemes.
Microsoft is aware of the issue as well, but there appears to be no info on what causes it.