Skip to content

Tag: sql-server-2014

Invalid object name ‘sys.dm_exec_input_buffer’

I’m trying to start a script in SQL Server 2014, but it can’t find the object in question. This is the query I am trying to initiate: Error message: Msg 208, Level 16, State 1, Line 1 Invalid object name ‘sys.dm_exec_input_buffer’. Answer You need to be on at least Service Pack 2. If y…

How to use ‘between’ in CASE statement?

I need to select Shift from my production table such that if the time time is between 05:00 PM to 06:30 AM it is Shift B else its Shift A. The SQL that I have written is quite simple but does not gives me the expected results. The SQL is The Result I get is Shift_FK_ID 1 1 1 Where

Naming a default constraint

I’m trying to create a default constraint here, but the system is generating a weird name for it. If I want to name it df_MY_TABLE_GUID or something, how could I specify that name be used? Answer Just specify the constraint name with the full syntax, like the UNIQUE in your example: As a matter of routi…