gpt4 book ai didi

sql - AWS MS SQL 创建表

转载 作者:行者123 更新时间:2023-12-02 03:20:47 25 4
gpt4 key购买 nike

我已按照本指南创建了一个 AWS MS SQL 数据库

https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_GettingStarted.CreatingConnecting.SQLServer.html#CHAP_GettingStarted.Connecting.SQLServer

我可以连接到它并使用命令

Select @@VERSION 

但是,当我尝试创建表时出现错误

Msg 262, Level 14, State 1, Line 1 CREATE TABLE permission denied in database 'master'.

我尝试的命令是

CREATE TABLE [RawInput] (
[DateTime] datetime,
[Text] text,
PRIMARY KEY ([DateTime])
);

最佳答案

分辨率:

USE [YOUR_DATABASE]

原因

什么是master数据库:

取自链接:https://learn.microsoft.com/en-us/sql/relational-databases/databases/master-database?view=sql-server-2017

The master database records all the system-level information for a SQL Server system. This includes instance-wide metadata such as logon accounts, endpoints, linked servers, and system configuration settings. In SQL Server, system objects are no longer stored in the master database; instead, they are stored in the Resource database. Also, master is the database that records the existence of all other databases and the location of those database files and records the initialization information for SQL Server. Therefore, SQL Server cannot start if the master database is unavailable.

任何用户级查询都不能使用 master 数据库运行,因为它会跟踪所有其他数据库

关于sql - AWS MS SQL 创建表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54875545/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com