SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Case Sensitivity in sp_describe_undeclared_parameters


Case Sensitivity in sp_describe_undeclared_parameters

Author
Message
Chris Downing
Chris Downing
SSC Veteran
SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)

Group: General Forum Members
Points: 234 Visits: 532
We recently upgraded one of our databases to 2012 Compatibility Mode, and are now getting an error from sp_describe_undeclared_parameters when running an SSIS package that one of the parameters isn't valid.

We've tracked it down to the parameter in the command in the package not having the same case as the parameter in the stored procedure. This obviously wasn't an issue prior to 2012, and we've been able to reproduce it with other stored procedures and parameters.

Both the server and database have collations of SQL_Latin1_General_CP1_CI_AS, so I'm not sure where this case sensitivity is coming from...

Anyone run into something similar? Thanks!
HowardW
HowardW
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2249 Visits: 9892
That's odd. The collation of both the user and system databases is case-insensitive?

I guess it's possible there were changes around this for contained databases, but system procedures have always followed the case sensitivity rule of the database you're connected to at the time, AFAIK. Does the problem appear/go away when changing the compatibility mode?

Does the following query bring back any databases with a case-sensitive collation?


SELECT DISTINCT collation_name FROM sys.databases


Chris Downing
Chris Downing
SSC Veteran
SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)

Group: General Forum Members
Points: 234 Visits: 532
Collation is SQL_Latin1_General_CP1_CI_AS returned from that query...

I suspect it would be easy for anyone to reproduce unless something in our setup is weird.

Here's a quick script...


create proc test @test1 varchar(128) as
select * from sys.objects where [name] = @test1

exec sp_describe_undeclared_parameters N'exec test @test1 =@P1'
exec sp_describe_undeclared_parameters N'exec test @Test1 =@P1'

exec test @test1 = 'test'
exec test @Test1 = 'test'



The sproc is created fine for me, the first sp_describe_undeclared_parameters runs fine, the second returns the error about the parameter not being valid, and the last two both run successfully.
HowardW
HowardW
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2249 Visits: 9892
Ah, I see. sp_describe_undeclared_parameters is a new 2012 proc.

Yes, I get the same result.

So is SSIS 2012 executing this statement as part of it's internal validation routines, or have you added it to your code?

Sounding like a bug to me, it should definitely follow the case sensitivity of the database.
Chris Downing
Chris Downing
SSC Veteran
SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)

Group: General Forum Members
Points: 234 Visits: 532
We're using an OLEDB Command task to execute the stored procedure, and I believe that treats it as dynamic SQL and executes that new system sproc as part of validation (we're not doing it explicitly). So this worked fine prior to 2012 obviously, but once we upgrade, it started erroring out when it hit that task.
HowardW
HowardW
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2249 Visits: 9892
Chris Downing (7/25/2013)
We're using an OLEDB Command task to execute the stored procedure, and I believe that treats it as dynamic SQL and executes that new system sproc as part of validation (we're not doing it explicitly). So this worked fine prior to 2012 obviously, but once we upgrade, it started erroring out when it hit that task.


OK. Definitely sounds like a bug. Have you got support with Microsoft?
Chris Downing
Chris Downing
SSC Veteran
SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)

Group: General Forum Members
Points: 234 Visits: 532
HowardW (7/25/2013)
OK. Definitely sounds like a bug. Have you got support with Microsoft?


I posted over on the MS Forums as well and basically got a "yep, this is how it works for me too", as well as a work around. The work around (to not explicitly have the parameter names in the exec query) works, but doesn't actually prevent us from having to make a bunch of changes, and may not even work in certain situations.

So I've opened up a bug here... https://connect.microsoft.com/SQLServer/feedback/details/795002/sp-describe-undeclared-parameters-case-sensitive-despite-collation

Thanks for checking it out and confirming we aren't crazy!
HowardW
HowardW
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2249 Visits: 9892
I've up-voted it and confirmed I can reproduce
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search