Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2002
    Location
    Shanghai , China
    Posts
    63

    Unanswered: How to invisible the table I created ?

    How to invisible the tables I created ?
    ( I create the table and I want to hide their names ...)
    Oracle is an ocean . I am just a little fish

  2. #2
    Join Date
    May 2002
    Posts
    299

    Re: How to invisible the table I created ?

    The short answer is 'no'.

    What are you trying to do exactly. Who are you hiding from.
    --
    -oj
    http://www.rac4sql.net

  3. #3
    Join Date
    Feb 2003
    Posts
    109

    uh do you mean a temporary table?

    if you prefix the tablename with a pound symbol, then it will be temporary.

    but i would do soemthing more along the lines of a UDF Table Function--

    this will return a virtual table where you dont have to hide anything-- and you can require passwords specific to that UDF, etc.

    in other words-- you make one of the variables for the UDF = password and in the tsql, if the @password <> 'mysecretpassword' then END

    or something along those lines.

    it should work like a charm!!
    Access 2002 ADP Rocks my World

    Long live SQL Server and 64bit Windows!!!

  4. #4
    Join Date
    Dec 2002
    Posts
    1,245

    Re: How to invisible the table I created ?

    It sounds to me like you are trying to restrict access to selected tables. In MS Access, this could be done by making the tables hidden (an imperfect solution, but one that worked 95% of the time).

    In SQL Server, you can't "hide" the tables, but you can GRANT privileges to users (or better yet, GRANT the privileges to ROLES and assign users to ROLES).

    For Example:

    Code:
    CREATE myTable (
        foo varchar(10) not null,
        bar int
    )
    GO
    
    CREATE myTableNoAccess (
        foo varchar(10) not null,
        bar int
    )
    GO
    
    sp_addlogin N'testUser', N'testPassword'
    GO
    
    sp_addrole N'testRole', N'dbo'
    GO
    
    GRANT SELECT ON myTable TO testRole
    GO
    
    sp_addrolemember N'testRole', N'testUser'
    GO
    Now login to your SQL server as testUser. You should be able to SELECT from myTable, but not from myTableNoAccess.

    Some notes:
    • 1. Avoid granting privileges to users; grant privileges to roles and add users to roles.
      2. SQL Security can be a pain, but it can also be extremely effective and it's a very good practice. Buidling it in from the start is a lot easier than trying to retrofit it.
      3. You can gain even greater security by isolating security to EXECUTION privileges on stored procedures; then users can only interact with the data in predictable ways.


    HTH,

    Hugh Scott


    Originally posted by ligang
    How to invisible the tables I created ?
    ( I create the table and I want to hide their names ...)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •