
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2016 09:25 PM
When I query the htblTicketAssets table, I get a list comparable to:
ticketid| assetid
1 | 123
1 | 456
1 | 159
1 | 753
2 | 789
2 | 126
2 | 7851
... ...
The query is:
I need to add a list of asset to ticket 25. I have a powershell function iterating through the list of AssetID's but whenever I try to add one to the table I get this error:
The update statement is:
But clearly the keys are not unique when I query it.
ticketid| assetid
1 | 123
1 | 456
1 | 159
1 | 753
2 | 789
2 | 126
2 | 7851
... ...
The query is:
SELECT * FROM htblticketassets
I need to add a list of asset to ticket 25. I have a powershell function iterating through the list of AssetID's but whenever I try to add one to the table I get this error:
Violation of PRIMARY KEY constraint 'PK_htblticketasset'. Cannot insert duplicate key in object 'dbo.htblticketasset
The update statement is:
INSERT INTO htblticket (ticketid,assetid) VALUES(25, $AssetID)
But clearly the keys are not unique when I query it.
Labels:
- Labels:
-
General Discussion
0 REPLIES 0
