CREATE TABLE permission denied in database 'tempdb'

后端 未结 6 1139
野的像风
野的像风 2021-02-18 17:45

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

6条回答
  •  别那么骄傲
    2021-02-18 18:37

    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.

提交回复
热议问题