|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Trying to append a field if an insert happens to contain a duplicate
I deliberately intend to add some duplicates to one of my tables. For eg
Job User IsAdmin JobID 235 User ID 1 JobID 235 User ID 5 JobID 235 User ID 9 JobID 235 User ID 5 JobID 235 User ID 2 JobID 235 User ID 9 JobID 235 User ID 10 JobID 235 User ID 1 I know its bad practice to do such a thing but there is a genuine reason. What I need to do is to be able to have a SQL statement that appends true to the IsAdmin field whenever it encounters the next UserID thats happens to be a duplicate. Hence the above would look like: Job User IsAdmin JobID 235 User ID 1 JobID 235 User ID 5 JobID 235 User ID 9 JobID 235 User ID 5 True JobID 235 User ID 2 JobID 235 User ID 9 True JobID 235 User ID 10 JobID 235 User ID 1 True Thanks |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > Trying to append a field if an insert happens to contain a duplicate |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|