First time I installed SQL Server Management Studio Express and Visual Studio 2005 on my system. Now I am trying to create table by using below script. But if once I execute I a
You're trying to create a permanent table in tempdb
. That's rather unusual, tempdb is completely wiped out whenever the SQL Server service restarts.
The normal way to create a temporary table is:
create table #TempTable (...
The #
makes it a local (connection-specific) temporary table. A global temporary table starts with ##
. No special rights are required to create a temporary table this way.