【发布时间】:2012-08-06 09:19:53
【问题描述】:
我需要在 SQL Server 2008 中执行 SQL Server 2005 生成的数据库查询(主要是存储过程)。在执行此过程时我需要记住什么...?
当我执行上述过程时,脚本不会执行...
请帮我解决这个问题
尼莱什·佩塔尼
很抱歉在评论中包含代码...
这是我在没有任何 SET 命令的情况下执行的示例过程,但它仍然无法正常工作...
CREATE PROCEDURE [dvx_web_MICROSITES_LoadMicrosites]
AS
BEGIN
SELECT
microsite_id AS ID,
url as URL,
[name] as [Name],
catery_id as CateryID,
catery_code as CateryCode,
banner_key as Banner,
main_banner_key as MainBanner,
special_zone_id as SpecialZone,
homepage_url as MainLink,
active as Active,
custom_01 as Custom01,
custom_02 as Custom02,
custom_03 as Custom03,
custom_04 as Custom04,
custom_05 as Custom05
FROM
Microsites
WHERE
Active = 1
ORDER BY [Name] ASC
END
【问题讨论】:
-
如果您有任何错误消息,最好在此处发布您的代码和错误消息。
-
检查您是否使用了in the list of breaking changes in SQL 2008 中提到的任何内容 - 这是一个在 SQL Server 2005 中可以使用但在 2008 年无法使用的东西的列表。
-
这是一个示例存储过程脚本 这是一个示例存储过程脚本 SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON CREATE PROCEDURE [dvx_web_MICROSITES_LoadMicrosites] AS SELECT microsite_id AS ID, url as URL, [name] as [Name] , category_id 作为 CategoryID, category_code 作为 CategoryCode, banner_key 作为 Banner, main_banner_key 作为 MainBanner, special_zone_id 作为 SpecialZone, homepage_url 作为 MainLink, active 作为 Active, custom_01 作为 Custom01, custom_02 作为 Custom02, custom_03 作为 Custom03, custom_04 作为 Custom04, custom_05 作为 Custom05 FROM Microsites WHERE Active = 1 ORDER BY [Name] ASC
-
请不要将代码示例或示例数据放入 cmets - 因为您无法对其进行格式化,所以阅读它非常困难....而是:更新您的问题,编辑它以提供附加信息!谢谢。
-
我已经从 sql 2005 生成数据库脚本,带有为 SQL Server 2005 生成选项并在 sql 2008 上执行该脚本...它给我错误...?
标签: sql-server sql-server-2005 stored-procedures