Need help in understanding the error "The operation failed because an index or statistics with name 'XPKUSERS'" and help in converting the query to TSQL
CREATE TABLE TDM_USERS_AUTH
(
USER_ROLE_ID VARCHAR(3) NOT NULL
, ROLE VARCHAR(100) NOT NULL
, USER_ID VARCHAR(15) NOT NULL
);
CREATE UNIQUE INDEX XPKUSERS ON TDM_USERS_AUTH (USER_ROLE_ID ASC);
ALTER TABLE TDM_USERS_AUTH
ADD CONSTRAINT XPKUSERS PRIMARY KEY
(
USER_ROLE_ID
)
USING INDEX XPKUSERS;
Msg 1913, Level 16, State 1, Line 1
The operation failed because an index or statistics with name 'XPKUSERS' already exists on table 'TDM_USERS_AUTH'.
Msg 1750, Level 16, State 0, Line 1
Could not create constraint or index. See previous errors.