SQL Server 2008 Management Studio – Running Parameterized Query
I would typically use the
CTRL-Shift-M functionality in SSMS. See following example with instructions. Bit tedious but hey, better than nothing.
--=============================================== -- Purpose: Search all objects for specified Text --=============================================== -- Instructions: CTRL-A + CTRL-Shift-M, enter text -- to search, click Ok and press F5. -- To repeat search with other text: CTRL-Z (undo) -- and then repeat above. SELECT o.Name AS [Object Name] ,o.xType AS [Object Type] ,s.TEXT AS [Object Text] FROM sySobjects o, sysComments s WHERE o.Id = s.Id AND TEXT LIKE '%<Text To Search,,>%'
I don’t believe this is possible.
What I usually do in this case is just add the following to the top of the window:
declare @id int set @id = 10 -- followed by the parameterized query
Actually, I think 2008 supports initialization now:
declare @id int = 10