Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT/INSERT Question
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01478284
Message ID:
01478286
Vues:
25
>>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
I want to duplicate all 4 rows, but setting the RoleKey.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform