How can I allow users sql access to a table limited to certain rows?

后端 未结 3 671
傲寒
傲寒 2020-12-20 05:40

I\'m building an stock exchange simulation game. I have a table called \'Market_data\' and in the game players simulate being in particular dates and are allowed to use SQL

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-20 06:19

    The basic way would be :

    -> Prevent that user (or group) from accessing the base table.

    -> Define a view on top of that table that shows only the rows these users are supposed to see.

    -> Give those users SELECT permission on the view.

    -> And you can also use SQL Encryption,Decryption and Hashing concept.

    Encryption & Decryption examples can be found here:

    http://msdn.microsoft.com/en-us/library/ms179331.aspx

    Hashing example can be found here:

    http://msdn.microsoft.com/en-us/library/ms174415.aspx

提交回复
热议问题