Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT/INSERT Question
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01478284
Message ID:
01478285
Views:
34
>Assuming the following Rights table, how do you select out the right, change the RoleKey to some value, and then reinsert those rows back into this table?
>
>
>RightKey    RoleKey     UserKey     RightName                                          RightCode                                          AllowDeny
>----------- ----------- ----------- -------------------------------------------------- -------------------------------------------------- -----------
>27          NULL        NULL        Add User                                           sys_add_user                                       1
>28          NULL        NULL        Edit User                                          sys_edit_user                                      1
>29          NULL        NULL        Remove User                                        sys_remove_user                                    1
>30          NULL        NULL        Lock User                                          sys_lock_user                                      1
>
>
>Thanks
>
>Kevin

The question is not clear. Do you want to just update a record, or insert a record with a different RoleKey, but the same information in other fields?
insert into @Roles
(RoleKey, UserKey, etc.) select 'SomeRole', UserKey, etc. from @Roles where RightKey = @RightKey
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform