问题描述
- SQLServer数据迁移写的查询脚本错误
-
USE symedia_4_0_developmentGO
if exists(select * from dbo.sysobjects where name='ckeditor_assets')
drop table ckeditor_assets
GO
CREATE TABLE ckeditor_assets (
id int NOT NULL,
data_file_name varchar(255) NOT NULL,
data_content_type varchar(255) DEFAULT NULL,
data_file_size int DEFAULT NULL,
assetable_id int DEFAULT NULL,
assetable_type varchar(30) DEFAULT NULL,
type varchar(30) DEFAULT NULL,
width int DEFAULT NULL,
height int DEFAULT NULL,
created_at datetime DEFAULT NULL,
updated_at datetime DEFAULT NULL,
PRIMARY KEY (id),
/*KEY idx_ckeditor_assetable_type (assetable_type,type,assetable_id),*/
/*KEY idx_ckeditor_assetable (assetable_type,assetable_id)*/
);
exec sp_msforeachtable "sp_changeobjectowner '?','dbo'"
INSERT INTO symedia_4_0_development.dbo.ckeditor_assets(id,data_file_name,data_content_type,data_file_size,assetable_id,assetable_type,width,height,created_at,updated_at) SELECT (news_id,file_name,,file_size,,,,band_width,,) FROM cms70.dbo.cms_news_file执行的结果是:
USE symedia_4_0_development[Err] 42000 - [SQL Server]',' 附近有语法错误。