|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Thursday, May 09, 2013 11:39 PM
Points: 61,
Visits: 54
|
|
It appears that whatever you hightlight is passed to the stored procedure as a single string. It doesn't parse out commas, and positively objects to quotes. So I bent to the wind, and simply parsed out the values from the single input parameter. This makes it uglier to use when not using the keyboard shortcut, but when will that happen?
Cheers!
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, April 24, 2013 12:11 PM
Points: 143,
Visits: 183
|
|
Yes, indeed, it treats the whole comma delim'd parameter as a string - BUT ONLY IN SSMS.
It works perfectly in SQA. I can't figure out why. One forum poster said it worked for him in SSMS.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 2:29 AM
Points: 2,677,
Visits: 2,277
|
|
Mike DiRenzo (3/10/2008) One forum poster said it worked for him in SSMS.
Yes and it still does!... even with multiple parameters and ones delimited by single quotes
create proc kev_test ( @param1 varchar(50), @param2 varchar(50) ) as set nocount on select 'the first parameter is ' + @param1 + ' the second is ' + @param2 assign Ctrl-5 to kev_test
new window..
'first param','second param' highlight it, press Ctrl-5 and results are
the first parameter is first param the second is second param
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Thursday, May 09, 2013 11:39 PM
Points: 61,
Visits: 54
|
|
Definitely there's some option/setup in SSMS -- even on the builtins, if I put single quotes around the string and press Alt-F1, it gives me the error:
Incorrect syntax near 'sp_help'.
I wouldn't have a clue where to go from that, though. MSDN Help has, as it often is, been unhelpful, and I haven't found the magic words for Google.
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Thursday, May 09, 2013 11:39 PM
Points: 61,
Visits: 54
|
|
Microsoft SQL Server Management Studio 9.00.1399.00 Microsoft Analysis Services Client Tools 2005.090.1399.00 Microsoft Data Access Components (MDAC) 2000.085.1117.00 (xpsp_sp2_rtm.040803-2158) Microsoft MSXML 2.6 3.0 4.0 5.0 6.0 Microsoft Internet Explorer 7.0.5730.11 Microsoft .NET Framework 2.0.50727.832 Operating System 5.1.2600 (XP Pro 2002 SP2)
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 2:29 AM
Points: 2,677,
Visits: 2,277
|
|
looks like you haven't applied SP2 to your client tools
Microsoft SQL Server Management Studio 9.00.3042.00 Microsoft Analysis Services Client Tools 2005.090.3042.00 Microsoft Data Access Components (MDAC) 2000.085.1117.00 (xpsp_sp2_rtm.040803-2158) Microsoft MSXML 2.6 3.0 4.0 5.0 6.0 Microsoft Internet Explorer 7.0.5730.13 Microsoft .NET Framework 2.0.50727.1433 Operating System 5.1.2600
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, April 24, 2013 12:11 PM
Points: 143,
Visits: 183
|
|
I have other similar macro scripts that work in SQA and not SSMS. It has been really frustrating not to be able to use them effectively in SSMS - especially if you are a type and typo centric TSQL'r.
I will apply SP2 and see if it works. Thanks for the posts and the insight re: SP2.
-Mike
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Thursday, May 09, 2013 11:39 PM
Points: 61,
Visits: 54
|
|
That does the trick! Thanks!
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Monday, November 05, 2012 1:00 PM
Points: 128,
Visits: 32
|
|
Top tip for working with the INFORMATION_SCHEMA views: use Excel to view them.
In Excel, go to Data, Import External Data..., then either Import Data or New Database Query. Use or create a DSN and fish out the INFORMATION_SCHEMA view that your interested in. COLUMNS is the one I use the most.
Then use Excel's Autofilter and you got yourself a Data Dictionary that you can filter to find, say, all fields with the same name, all fields of the same datatype (use char instead of nchar and have a feeling you've done it somewhere else too?), or whatever.
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 7:18 AM
Points: 33,112,
Visits: 27,038
|
|
Andrew_Webster (3/18/2008) Top tip for working with the INFORMATION_SCHEMA views: use Excel to view them.
In Excel, go to Data, Import External Data..., then either Import Data or New Database Query. Use or create a DSN and fish out the INFORMATION_SCHEMA view that your interested in. COLUMNS is the one I use the most.
Then use Excel's Autofilter and you got yourself a Data Dictionary that you can filter to find, say, all fields with the same name, all fields of the same datatype (use char instead of nchar and have a feeling you've done it somewhere else too?), or whatever.
Hadn't thought about that... that's a very clever and useful idea! Thanks, Andrew!
--Jeff Moden "RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
|
|
|
|