Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT TOP 14 ContactAssociate
- FROM tb_Contact
- WHERE tb_Contact.ContactAssociate = 'David'
- ORDER BY NEWID()
- UPDATE tb_Contact
- SET ContactAssociate = 'Peter'
- IN
- (
- SELECT TOP 14 ContactAssociate
- FROM tb_Contact
- WHERE tb_Contact.ContactAssociate = 'David'
- ORDER BY NEWID()
- )
- UPDATE tb_Contact
- SET ContactAssociate = 'Peter'
- where PK_Of_tb_Contact
- IN
- (
- SELECT TOP 14 PK_Of_tb_Contact
- FROM tb_Contact
- WHERE tb_Contact.ContactAssociate = 'David'
- ORDER BY NEWID()
- )
- UPDATE c
- SET ContactAssociate = 'Peter'
- FROM tb_Contact c
- INNER JOIN (
- SELECT TOP 14 ContactAssociate FROM tb_Contact
- WHERE tb_Contact.ContactAssociate = 'David'
- ) q ON c.ContactAssociate = q.ContactAssociate
- SELECT c.*
- FROM tb_Contact c
- INNER JOIN (
- SELECT TOP 14 ContactAssociate FROM tb_Contact
- WHERE tb_Contact.ContactAssociate = 'David'
- ) q ON c.ContactAssociate = q.ContactAssociate
- DECLARE @sample int
- SET @sample = 7
- UPDATE tb_Contact
- SET ContactAssociate = 'Peter'
- where PK_Of_tb_Contact
- IN
- (
- SELECT TOP (@sample) PERCENT PK_Of_tb_Contact
- FROM tb_Contact
- WHERE tb_Contact.ContactAssociate = 'David'
- ORDER BY NEWID()
- )
Add Comment
Please, Sign In to add comment