Are SQL stored procedures case sensitive?
-
21-08-2019 - |
Question
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...
Solution
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.
OTHER TIPS
No. Not T-SQL at least...
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.