How to transfer git repositories from GitLab to GitHub?
MS SqlServer: unique statement
Andriy AndrunevchynDon’t use UNIQUE statement like
LOGIN varchar(100) NOT NULL UNIQUE
SqlServer will create constraint with random name like UQ__TableName__E39E26653F9E5D18
If you use some automation tool like Flyway you will not be able remove that constraint easily because each time when you recreate table you will get new constraint name
Better solution is following
CONSTRAINT UQ__TableName__LOGIN UNIQUE(LOGIN)
in such case you can be sure query
ALTER TABLE [dbo].[USERS] DROP CONSTRAINT UQ__USERS__E39E26653F9E5D18
will work properly
Comments
0
There are currently no comments.