Skip to content

Tag: constraints

Rename a constraint in SQL Server?

Is it possible to rename a constraint in SQL Server? I don’t want to have to delete and create a new one because this constraint affects other already existing constraints and I will have to recreate/alter those. Answer You can rename using sp_rename using @objtype = ‘OBJECT’ This works on o…

Displaying the constraints in a table

Hello I am trying to display the constraints in one of my tables but for some reason I get the message no rows selected. Noted below is the table I have created. This is the code I am using to show my constraints. I am a rookie so I want to make sure I understand what is wrong. I have