解决sql server中批处理过程中“'CREATE/ALTER PROCEDURE 必须是查询批次中的第一个语句”
来源:互联网 发布:淘宝模特 编辑:程序博客网 时间:2024/05/14 04:35
-----------------------------------------line-------------------------------------------------USE [p20-cy-2966];/* V1.0.2版本SQL批处理*/--判断某表的某字段是否存在if (not exists(select * from syscolumns where id=object_id('BlanceManageO2O') and name='OrderInfoNum'))ALTER TABLE BlanceManageO2O ADD OrderInfoNum INT DEFAULT 0;GO--判断某存储过程是否存在if (exists (select * from sys.objects where name = 'sp_BlanceOrderInsertCatering')) drop proc sp_BlanceOrderInsertCateringGOCREATE PROCEDURE [dbo].[sp_BlanceOrderInsertCatering] -- 由存储过程SettlementManageO2O 中传入值@ShopId int,@AgentId int,@BlanceId int, @IndustryId int, --行业类型 行业Id 1-零售 2-餐饮 3-酒店 4-娱乐 5-家政 6-旅游 7-二手@Yearint, --年@Month int, --月@Dayint, --日@O2OShopPercent decimal(18,2), --020提成百分比@WeixinPoundaga decimal(18,2), -- 获取系统设置PlatBaseSet表中的微信支付手续费百分比 @TransferPriceSum decimal(18,2) output ASBEGIN--处理程序ENDGO--判断某存储过程是否存在if (exists (select * from sys.objects where name = 'SettlementManageCatering')) drop proc SettlementManageCateringGOCREATE PROCEDURE [dbo].[SettlementManageCatering]ASBEGIN --处理程序ENDGO-----------------------------------------line-------------------------------------------------USE [p20-cy-2967];/* V1.0.2版本SQL批处理*/--判断某表的某字段是否存在if (not exists(select * from syscolumns where id=object_id('BlanceManageO2O') and name='OrderInfoNum'))ALTER TABLE BlanceManageO2O ADD OrderInfoNum INT DEFAULT 0;GO--判断某存储过程是否存在if (exists (select * from sys.objects where name = 'sp_BlanceOrderInsertCatering')) drop proc sp_BlanceOrderInsertCateringGOCREATE PROCEDURE [dbo].[sp_BlanceOrderInsertCatering] -- 由存储过程SettlementManageO2O 中传入值@ShopId int,@AgentId int,@BlanceId int, @IndustryId int, --行业类型 行业Id 1-零售 2-餐饮 3-酒店 4-娱乐 5-家政 6-旅游 7-二手@Yearint, --年@Month int, --月@Dayint, --日@O2OShopPercent decimal(18,2), --020提成百分比@WeixinPoundaga decimal(18,2), -- 获取系统设置PlatBaseSet表中的微信支付手续费百分比 @TransferPriceSum decimal(18,2) output ASBEGIN--处理程序ENDGOif (exists (select * from sys.objects where name = 'SettlementManageCatering')) drop proc SettlementManageCateringGOCREATE PROCEDURE [dbo].[SettlementManageCatering]ASBEGIN --处理程序ENDGO
阅读全文
0 0
- 解决sql server中批处理过程中“'CREATE/ALTER PROCEDURE 必须是查询批次中的第一个语句”
- 'CREATE FUNCTION' 必须是查询批次中的第一个语句。
- 添加新记录并判断唯一时:必须是查询批次中的第一个语句
- create function 必须是批处理中仅有的语句
- 'CREATE PROCEDURE' 必须是批查询中的第一条语 之解决方案
- 如何在SQL Server查询语句(Select)中检索存储过程(Store Procedure)的结果集?(
- SQL错误:”***“必须是批处理中仅有的语句
- 数据库视图建立--“create view必须是批处理中仅有的语句”
- T-SQL 中 CREATE PROCEDURE 语法
- Sql Server Alter语句
- Sql Server Alter语句
- Sql Server Alter语句
- sql server create synonym 用同义词解决程序升级过程中架构名称改变的问题
- SQL写存储过程时报错 'CREATE/ALTER PROCEDURE' must be the first statement in a query batch.
- SQL写存储过程时报错 'CREATE/ALTER PROCEDURE' must be the first statement in a query batch.
- SQL Server中查询语句sql等SQL Server2008
- SQL中利用sql语句查询数据库中的所有表、存储过程
- sql server 2005 T-SQL ALTER PROCEDURE (Transact-SQL)
- 文本处理三剑客之AWK
- Saltstack批量编译部署nginx(多模块)
- 分布式与集群的区别
- 不可重复读和幻读的区别(悲观锁和乐观锁)
- jquery使用总结
- 解决sql server中批处理过程中“'CREATE/ALTER PROCEDURE 必须是查询批次中的第一个语句”
- jquery ajax调用函数封装
- 异构计算与高性能计算_是打开未来的两把钥匙
- AsyncTask下载图片
- 尺取法
- java发展趋势
- Win10《芒果TV》更新v3.6.0秋收版:新增追剧磁贴、记忆续播、跳转列表
- 中企18年,高度相同,才能相融
- Swift