|
Posted by Erland Sommarskog on 09/21/06 21:53
(billharrison9@gmail.com) writes:
> I need to be able to drop a table after a user is done with it. I have
> tried something like,
>
> DROP TABLE USER.tblEducation_SAP1
>
> but I get an error.
And the error message is? Of course, if that is the exact command line
you would get a syntax error since USER is a reserved word in T-SQL. But
I don't know whether that USER is just a place holder.
> Can someone suggest the way I should be using the USER value in this
> instance?
You could use dynamic SQL. Then again, if you are on SQL 2000 you could
just say
DROP TABLE tblEducation_SAP1
since the default schema for a user always agrees with the name of the
user. (This is a little different on SQL 2005 where users and schema
are separate.)
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|