使用 Server Management Studio 从 SQL Server Express SQL Compact 导入数据库
我尝试将使用 Server Management Studio 生成的 sql 脚本导入到 SQL Compact 3.5 中,但出现了很多错误。我做错了什么?
我使用“任务/生成脚本”上下文菜单生成脚本。我的脚本的一部分:
CREATE TABLE [LogMagazines](
[IdUser] [int] NOT NULL,
[Text] [nvarchar](500) NULL,
[TypeLog] [int] NOT NULL,
[DateAndTime] [datetime] NOT NULL,
[DetailMessage] [nvarchar](max) NULL,
[Id] [int] IDENTITY(1,1) NOT NULL,
CONSTRAINT [PK_LogMagazines] PRIMARY KEY
(
[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]
知识库:
I try to import sql script, generated with Server Management Studio, into SQL Compact 3.5 and get a lot of error. What I am doing wrong?
I generate script with "Task/Generate Script" context menu. Part of my script:
CREATE TABLE [LogMagazines](
[IdUser] [int] NOT NULL,
[Text] [nvarchar](500) NULL,
[TypeLog] [int] NOT NULL,
[DateAndTime] [datetime] NOT NULL,
[DetailMessage] [nvarchar](max) NULL,
[Id] [int] IDENTITY(1,1) NOT NULL,
CONSTRAINT [PK_LogMagazines] PRIMARY KEY
(
[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]
Knowledge Base:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SQL Server Compact 3.5 不支持完整的 SQL Server(非 Compact)DLL/功能集。例如,不支持 nvarchar(max),也不支持 ON PRIMARY 语法,因为紧凑数据库存储在单个文件中。
参考号SQL Server Compact Edition 创建表:
链接文本
SQL Server Compact 3.5 does not support the full SQL Server (non-Compact) DLL/feature set. E.g. nvarchar(max) is not supported, nor is the ON PRIMARY syntax, since the compact database is stored in a single file.
Ref. SQL Server Compact Edition CREATE TABLE:
link text