Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
nmulvihill
Engaged Sweeper II
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:
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.
0 REPLIES 0

Archive

This board contains archived posts from the retired Lansweeper Forum and Insiders Community.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now