February 25, 2014 at 11:36 pm
Can I add a primary key constraint after data is loaded is loaded into the table?If not then how can I ensure that the data from now on is unique?
Thanks.
February 26, 2014 at 1:09 am
Yes, you can add a PK after data has been loaded into the table.
You can also use a unique contstraint to check if data is unique.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
February 26, 2014 at 1:49 am
Assuming that earlier loaded data has duplicates which is fine and now I want to upload only duplicate data.Any query would help.Thanks!1
February 26, 2014 at 1:50 am
Assuming that earlier loaded data has duplicates which is fine and now I want to upload only unique
data.Any query would help.Thanks!1
February 26, 2014 at 2:02 am
gsaini 95591 (2/26/2014)
Assuming that earlier loaded data has duplicates which is fine and now I want to upload only uniquedata.Any query would help.Thanks!1
This could be realized with a unique filtered index.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
February 27, 2014 at 4:16 am
I don't think you can add primary key on the column which has duplicates values already
February 27, 2014 at 4:18 am
Sushil Dwivedi (2/27/2014)
I don't think you can add primary key on the column which has duplicates values already
Indeed. That's why I suggested an unique filtered index.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply