User wise temporary table ,User Administration

  • In my scenario

    There are 10 users of the Database in Sql server 2005.

    users staring with FWACDH/XYZ, FWACDH/ABC and so on....

    I am using one SP , which is generation one table and uses that table for some manipulation.

    Later on in same SP i drop that table.

    Now problem is when user logeed into the system using this SSPI authentication.

    He is not able to drop a table because i have written simplate

    ddl statment to drop that table in that store procedure. like drop table Tablename.

    When i saw that table in table list it was something like FWACDH/XYZ.Tablename instead of Dbo.tabelname.

    So how should i write drop statment in my storeprocedure so that it drops this table.

    Do i need to check who is the user logged in this database and that i have to write drop statment according to that?

    Help me out.

  • Why don't you use temp tables, then you will have no such worries. Also means that your users won't need create table rights in your database.

    CREATE TABLE #TableName ...

    ...

    DROP TABLE #TableName

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Please don't cross post. Answered here: http://www.sqlservercentral.com/Forums/Topic572937-146-1.aspx

  • Steve Jones - Editor (9/20/2008)


    Please don't cross post. Answered here: http://www.sqlservercentral.com/Forums/Topic572937-146-1.aspx

    Umm.. recursive link. Did you mean here -

    http://www.sqlservercentral.com/Forums/Topic572938-359-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply