仓库表:
warehouseid,warehousename;
用户表:
userid,username
权限表:
authorityid,warehouseid,userid,authorityflag
其中authorityflag=0  无权限
                 =1  只读
                 =2  读写
关联这三张表就可以了。还有加上入库表4张表关联。

解决方案 »

  1.   

    还可以把用户分组,仓库表:
    warehouseid,warehousename;
    用户表:
    userid,username,groupname
    权限表:
    authorityid,warehouseid,groupname,authorityflag
    其中authorityflag=0  无权限
                     =1  只读
                     =2  读写
      

  2.   

    你说得办法不可以直接实现,不过你可以写成存贮过程,比如
    select * from tabllename where 权限字段=@权限值
      

  3.   

    我覺得寫成視圖更好,例如:
    create view as select * from a where table1 where a = 1
    create view as select * from a where table2 where a = 2
     .......
    然後可對不同的視圖受權
      

  4.   

    To okokwukai(不老仙翁):
       
       这倒是一个不错的方法,我来好好学习中间件To  win32c(win32c),  desky(JoeDesky), starky(爱在西元前), TheAres(班门斧)、 WQLu(午夜的陽光):
       
        谢谢你们