CREATE TABLE permission denied in database 'tempdb'

后端 未结 6 1112
野的像风
野的像风 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

    I faced this problem too. Searched for it, most of the answers were of db_owner, checked that too in Security menu item, but it was not being shown. While searching i went to this blog. Ivan Dimitrov's answer gave me a bit hint. My create table query was:

    CREATE TABLE [dbo].[Album](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [Name] [nvarchar](150) NULL,
    [Description] [nvarchar](500) NULL,
    [TrackCount] [int] NULL,
    [ReleaseYear] [int] NULL,
    [Distributor] [nvarchar](500) NULL,
    [ImageUrl] [nvarchar](max) NULL,
    [CreatedDate] [datetime] NULL,
    CONSTRAINT [PK_Album] PRIMARY KEY CLUSTERED 
    (
    [Id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, 
    ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    

    I removed the [dbo]. from the query and then ran it, executed successfully. Maybe it is not a complete solution but i managed to work with it somehow.

提交回复
热议问题