MetaGuru
MetaGuru

Reputation: 43863

Are SQL stored procedures case sensitive?

for example...

ALTER PROCEDURE [dbo].[Reports_Dashboard_Get_Sav]   
    -- Add the parameters for the stored procedure here
    @startDate datetime,
    @endDate datetime,
    @companyID int=null

set @days=datediff(m,@startdate,@enddate)
if (@days)=0 
    set @days=1

This is not my code but if this is case sensitive then @days is not going to be calculated properly as the startDate/startdate and endDate/enddate variables don't match...

Upvotes: 8

Views: 14727

Answers (3)

Matt Hamilton
Matt Hamilton

Reputation: 204219

They can be, depending on your database's collation. When you install SQL Server and choose your default collation, you'll notice that there's a "case sensitivity" checkbox. Certain collations are case sensitive and will affect your queries (and stored procedures).

Worse still, many vendors don't test their products on servers with case sensitive collations, which leads to runtime errors.

Upvotes: 18

Soviut
Soviut

Reputation: 91585

As I recall, they are not case sensitive for the SQL commands themselves, I've routinely seen them written as lowercase. I'm pretty sure the rest is case-insensitive as well given that its an extension of the T-SQL spec.

Upvotes: 0

Shawn
Shawn

Reputation: 19813

No. Not T-SQL at least...

Upvotes: 1

Related Questions