I have a table like this:
+-------+--------------------------------------+------------------+--------------------------------------------------------+
| SecID | SecGuid | LevelType | Description |
+-------+--------------------------------------+------------------+--------------------------------------------------------+
| 1 | 550239E9-01A1-4403-8133-834DD0EBD7EA | Administrator | All Access Pass |
| 2 | 181104C8-2241-4E51-B73D-59D5E4E8C22D | Advanced Author | Edit, create, delete, archive, pricing, and agreements |
| 3 | 24E50493-854C-4C44-A074-E6D2EAAC5E5C | Mid Level Author | Edit, create, delete and archive |
| 4 | 306C087D-F86A-43F6-B57A-8C65F9E8337D | Author | Edit and create |
| 5 | 9B66AE7D-B704-4D75-8776-774A2CFC0C47 | Contibutor | Edit |
| 6 | 35B0F735-E240-47D0-9E33-694D6197C765 | Browser | View |
| 7 | E3606250-F5C5-4DED-B29F-53E6C6C91FDA | Banned | no access |
| 8 | B0A0F8E1-93F3-431F-A7BF-95F14C22703E | Low Level Author | Edit, create, delete, archive, Task assignation |
+-------+--------------------------------------+------------------+--------------------------------------------------------+
But now I want to change my last row to be under third one and change SecID
for 4 and of course change others under this row. So at the final, I want to achieve something like this:
+-------+--------------------------------------+------------------+--------------------------------------------------------+
| SecID | SecGuid | LevelType | Description |
+-------+--------------------------------------+------------------+--------------------------------------------------------+
| 1 | 550239E9-01A1-4403-8133-834DD0EBD7EA | Administrator | All Access Pass |
| 2 | 181104C8-2241-4E51-B73D-59D5E4E8C22D | Advanced Author | Edit, create, delete, archive, pricing, and agreements |
| 3 | 24E50493-854C-4C44-A074-E6D2EAAC5E5C | Mid Level Author | Edit, create, delete and archive |
| 4 | B0A0F8E1-93F3-431F-A7BF-95F14C22703E | Low Level Author | Edit, create, delete, archive, Task assignation |
| 5 | 306C087D-F86A-43F6-B57A-8C65F9E8337D | Author | Edit and create |
| 6 | 9B66AE7D-B704-4D75-8776-774A2CFC0C47 | Contibutor | Edit |
| 7 | 35B0F735-E240-47D0-9E33-694D6197C765 | Browser | View |
| 8 | E3606250-F5C5-4DED-B29F-53E6C6C91FDA | Banned | no access |
+-------+--------------------------------------+------------------+--------------------------------------------------------+
NOTE: Table have a constraint and SecID
is a primary key:
ALTER TABLE [dbo].[SecAccess] ADD CONSTRAINT [DF_SecAccess_SecGuid] DEFAULT (newid()) FOR [SecGuid]