- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我知道这不是什么大问题,但还是让我觉得很痒。
"Msg 156, Level 15, State 1, Procedure cpromo_Get_ConsultDetails_PromotionBan, Line 59 Incorrect syntax near the keyword 'PROCEDURE'.
这是我的脚本示例:
ALTER PROCEDURE [dbo].[cpromo_Get_ConsultDetails_PromotionBan]
(
@idPromoBan int,
@uid int
)
AS
begin
set nocount on;
/* 1- detail de la promo */
SELECT p.[nopromo], p.[StartDate], p.[EndDate], p.[DateText]
FROM [cpromo_PromotionBanniere] as pb
INNER JOIN [cpromo_Promotions] as p ON p.[idPromo] = pb.[idPromo]
WHERE (pb.[idPromoBan] = @idPromoBan)
/* 2 - cartes de la promo */
SELECT pis.[idCardText], ct.[nom], ct.[descr], ct.[prix], ct.[prixCoupon], ct.[qtyItem], i.[Impact]
FROM [cpromo_PromotionsItems] as pis
INNER JOIN [cpromo_Impacts] as i ON i.[idImpact] = pis.[idImpact]
INNER JOIN [cpromo_CardText] as ct ON ct.[idCardText] = pis.[idCardText]
WHERE (pis.[idPromoBan] = @idPromoBan)
ORDER BY i.[iorder], ct.[nom];
/* 3 - pvedettes opti */
SELECT m.[idCardText], m.[qtyCardL], m.[qtyCardM], m.[qtyCardMG], m.[qtyCardS],
ISNULL(m.[qtyCardMini], 0) as qtyCardMini,
ISNULL(m.[qtyCardMiniPTJ], 0) as qtyCardMiniPTJ
FROM [cpromo_MEMCards] as m
INNER JOIN [cpromo_CardText] as ct ON ct.[idCardText] = m.[idCardText]
WHERE (m.[idPromoBan] = @idPromoBan)
ORDER BY ct.[nom];
/* 4 - cart */
SELECT [idCartEl], [idCardText], [qtyL], [qtyM], [qtyMG], [qtyS],
ISNULL([qtyMini], 0) as qtyMini,
ISNULL([qtyMiniPTJ], 0) as qtyMiniPTJ
FROM [cpromo_UserCarts]
WHERE ([uid] = @uid AND [idPromoBan] = @idPromoBan);
end
ALTER PROCEDURE [dbo].[cpromo_Get_CartItems_ByPromotionBan]
(
@uid int,
@idPromoBan int
)
AS
begin
set nocount on;
SELECT ct.nom, ct.descr, p.DateText, ct.prix, ct.prixCoupon, ct.qtyItem,
uc.qtyL, uc.qtyM, uc.qtyMG, uc.qtyS,
isnull(uc.qtyMini, 0) as qtyMini,
isnull(uc.qtyMiniPTJ, 0) as qtyMiniPTJ, 3 as qteLimite
FROM cpromo_UserCarts as uc
INNER JOIN cpromo_CardText as ct ON ct.idCardText = uc.idCardText
INNER JOIN cpromo_PromotionBanniere as pb ON pb.idPromoBan = uc.idPromoBan
INNER JOIN cpromo_Promotions as p ON p.idPromo = pb.idPromo
WHERE (uc.uid = @uid) AND (uc.idPromoBan = @idPromoBan);
end
错误指向双击时遇到的第一个“end”关键字。我完全不明白的是,当一个接一个地选择 ALTER 语句时,它运行得很好而且很流畅!当我尝试在没有选择的情况下按 [F5] 来运行它们时,它给了我错误。
我试图将 ALTER 语句嵌入到另一个 BEGIN...END 中,但没有成功,它说关键字 ALTER... 附近存在语法错误
EDIT: Can it be because I comment the modifications performed after the begin statement?
ALTER PROCEDURE [dbo].[cpromo_Get_ConsultDetails_PromotionBan]
(
@idPromoBan int,
@uid int
)
AS
begin
------------------
-- Added column to take table changes into account blah blah blah...
------------------
set nocount on;
/* 1- detail de la promo */
SELECT p.[nopromo], p.[StartDate], p.[EndDate], p.[DateText]
FROM [cpromo_PromotionBanniere] as pb
INNER JOIN [cpromo_Promotions] as p ON p.[idPromo] = pb.[idPromo]
WHERE (pb.[idPromoBan] = @idPromoBan)
/* 2 - cartes de la promo */
SELECT pis.[idCardText], ct.[nom], ct.[descr], ct.[prix], ct.[prixCoupon], ct.[qtyItem], i.[Impact]
FROM [cpromo_PromotionsItems] as pis
INNER JOIN [cpromo_Impacts] as i ON i.[idImpact] = pis.[idImpact]
INNER JOIN [cpromo_CardText] as ct ON ct.[idCardText] = pis.[idCardText]
WHERE (pis.[idPromoBan] = @idPromoBan)
ORDER BY i.[iorder], ct.[nom];
/* 3 - pvedettes opti */
SELECT m.[idCardText], m.[qtyCardL], m.[qtyCardM], m.[qtyCardMG], m.[qtyCardS],
ISNULL(m.[qtyCardMini], 0) as qtyCardMini,
ISNULL(m.[qtyCardMiniPTJ], 0) as qtyCardMiniPTJ
FROM [cpromo_MEMCards] as m
INNER JOIN [cpromo_CardText] as ct ON ct.[idCardText] = m.[idCardText]
WHERE (m.[idPromoBan] = @idPromoBan)
ORDER BY ct.[nom];
/* 4 - cart */
SELECT [idCartEl], [idCardText], [qtyL], [qtyM], [qtyMG], [qtyS],
ISNULL([qtyMini], 0) as qtyMini,
ISNULL([qtyMiniPTJ], 0) as qtyMiniPTJ
FROM [cpromo_UserCarts]
WHERE ([uid] = @uid AND [idPromoBan] = @idPromoBan);
end
感谢任何帮助或提示。
最佳答案
这个答案不是我的,因为它是我得到的所有答案的结果。每个答案都有解决方案的一部分,所以我想把解决方案的所有要点都放在一个答案上。
希望有一天这会对某人有所帮助。
感谢大家,功劳归于你们!
关于sql-server-2005 - SQL Server 脚本 : ALTER PROCEDURE - Executing multiple ALTER PROCEDURE into one script without having to select each of the ALTER one after another,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1432757/
我知道这不是什么大问题,但还是让我觉得很痒。 我有一个 SQL Server 2005 脚本来创建新的数据表、约束、更改一些表以添加列、更改过程以将表更改考虑在内等。 一切正常,直到脚本遇到我的 AL
我需要一个包含三列的数据框:i、j(改变)和 k(j 的改变)。我有一个邻接矩阵(下面的示例)。从那里我可以获得一个图形对象并提取边缘列表。我如何操作数据以获得类似于下面的 WANT 数据框的输出?
假设我有这个 SQL 语句: ALTER TABLE dbo.[tbl] ALTER COLUMN col1 varchar(300) ALTER TABLE dbo.[tbl] ALTER COLU
我在表中有一列,因此它不再是 NVARCHAR(256),而是 NVARCHAR(MAX)。我知道执行此操作的命令 (ALTER TABLE ALTER COLUMN NVARCHAR(MAX))。我
我在表中有一列,因此它不再是 NVARCHAR(256),而是 NVARCHAR(MAX)。我知道执行此操作的命令 (ALTER TABLE ALTER COLUMN NVARCHAR(MAX))。我
假设我有这两个 ALTER TABLE: ALTER TABLE tableName ADD COLUMN colName INT(11) AFTER colName2 ALTER TABLE tab
我正在尝试扩展 IdentityUser 类。我添加了一个新类 ApplicationUser 并继承了 IdentityUser 类。迁移已成功添加,但在更新数据库时,出现错误“对象 'PK_Asp
我想将 sql server 2005 表中的列修改为 IDENTITY(1,1) 顺便说一句,该表是空的,要更改的列是主键。 该列也是另外两个表的外键。 谷歌搜索后我发现你不能使用Alter tab
这是我要实现的目标:我在列表中有四个按钮,每个按钮都有白色背景和独特的彩色边框。单击一个按钮时,其背景颜色将与其边框颜色相同。单击第二个按钮时,第一个按钮恢复正常,第二个按钮的背景填充第二个按钮的边框
我在 clickhouse 有一张 table ,比如“my_table”,它有复制品(my_table_rep1,...)。我需要添加一个列,类型为 float64,默认值 (-1)。 我该怎么做?
alter FUNCTION [Kuri].[fnGetAge](@kuri_cust_Id int,@amt decimal) RETURNS SMALLINT AS BEGIN D
我试图确保当我 mysqldump 数据库时约束在执行以下查询后按数字顺序排列。当我在没有 AFTER 的情况下进行转储(这不起作用)时,它显示 phppos_sales_ibfk_3 作为第一个约束
我有两个表:cleanup 和 uniqueEntries。它们都有一个自动递增的id作为主键。 uniqueEntries 的表结构来自 cleanup,如下所示: $sql = "CREATE T
我有一个包含以下数据和结构的表: Date Analyst Start Time Stop Time 4/2/2018 Bill Smith 7:00
This question already has answers here: Error renaming a column in MySQL
是否可以更改表的多(复合)列键? 示例表: CREATE TABLE `test_abc` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `
我尝试执行 oracle alter session 查询以更改语言设置,但失败并出现错误“ORA-01036:非法变量名称/编号”。 preparedStatement = connection.p
我正在与一位客户合作,他希望大型数据库中的每个表的每条记录都有历史数据,并且为了美观,希望这些列位于每个表的末尾。例如: 表名 主键 数据列 历史专栏 所以我的问题是,是否有一个 SQL 命令可以将列
我正在尝试更改 SQL Server 2000 更新触发器,但它一直挂着、挂着、挂着。为什么会发生这种情况,我该怎么做才能解决这个问题?这是一个长触发器,这可能是为什么? 触发代码较长,简化如下: A
我正在将我的 mysql 数据库表从 id (auto) 更改为 uid。 ALTER TABLE companies DROP PRIMARY KEY; ALTER TABLE companies
我是一名优秀的程序员,十分优秀!