将单个 SQLSERVER 2005 脚本转换为 SQL SERVER 2000 脚本 [英] Convert Single SQLSERVER 2005 Script to a SQL SERVER 2000 script

查看:33
本文介绍了将单个 SQLSERVER 2005 脚本转换为 SQL SERVER 2000 脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,首先我对数据库编程没有经验,只对基本的 SQL 查询进行编程.

Hi guys first of all I have no expirience with DB programing only basic SQL queries.

我有一个为 SQL Server 2005 FB 开发的 sql 脚本,我需要在 SQL Server 2000 中运行它.

I have an sql script that was devolped for SQL Server 2005 FB and I need to run it in SQL server 2000.

我没有原始的 2005 DB.只有一个脚本和一个 SQL 2000DB

我找到了很多转换整个数据库的指南,但我可以用一个脚本做什么?

I found many guides for converting a whole DB but what can I do with a single script?

这是一个很长的脚本,由于数据安全问题,我不能在这里分享.

it is a very long script that I cannnot share here because of datasecurity issues.

这里是错误

请帮助我.

推荐答案

指定索引选项的语法已更改 - 仔细查看 WITH 子句:

The syntax for specifying index options has changed - look closely at the WITH clause:

SQL Server 2000

CREATE [ UNIQUE ] [ CLUSTERED | NONCLUSTERED ] INDEX index_name
    ON { table | view } ( column [ ASC | DESC ] [ ,...n ] )
[ WITH < index_option > [ ,...n] ]
[ ON filegroup ]

SQL Server 2005 及更高版本

CREATE [ UNIQUE ] [ CLUSTERED | NONCLUSTERED ] INDEX index_name 
    ON <object> ( column [ ASC | DESC ] [ ,...n ] ) 
    [ INCLUDE ( column_name [ ,...n ] ) ]
    [ WITH ( <relational_index_option> [ ,...n ] ) ]
    [ ON { partition_scheme_name ( column_name ) 
         | filegroup_name 
         | default 
         }
    ]
[ ; ]

脚本中的 WITH 子句使用括号 ,这会导致错误.除非您知道脚本设置了一些特定的索引选项,否则您可以简单地删除所有 WITH ( ... ) 子句.

The WITH clauses in your script use parentheses  and that causes the error. Unless you know that the script sets some specific index options, you can simply remove all the WITH ( ... ) clauses.

这篇关于将单个 SQLSERVER 2005 脚本转换为 SQL SERVER 2000 脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆