Case Sensitivity in sp_describe_undeclared_parameters

  • 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!

  • 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

  • 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.

  • 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.

  • 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.

  • 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?

  • 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!

  • I've up-voted it and confirmed I can reproduce

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply