网站首页
网站导航
Ctrl+D收藏
首 页
代码段
源码包
文档库
工具箱
代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
MSSQL
】
交换数据
作者:
明蔚
/ 发布于
2016-3-21
/
315
create procedure Exchange @id1 int, @id2 int as declare @tempUrl varchar(max) declare @tempImageUrl varchar(max) declare @tempTitle varchar(max) declare @tempGroup_purchase_price varchar(50) declare @tempDiscount varchar(50) declare @tempOriginal_Price varchar(50) declare @tempSold varchar(50) declare @tempGroup_purchase_info_name varchar(50) declare @tempCity varchar(50) declare @tempRegion varchar(50) declare @tempStartTime varchar(max) declare @tempEndTime varchar(max) declare @tempPurchase_type varchar(50) --交换 a和b --t=a set @tempUrl =(select url from TB_Group_Purchase_Info where id=@id1) set @tempImageUrl =(select imageUrl from TB_Group_Purchase_Info where id=@id1) set @tempTitle=(select title from TB_Group_Purchase_Info where id=@id1) set @tempGroup_purchase_price=(select group_purchase_price from TB_Group_Purchase_Info where id=@id1) set @tempDiscount=(select discount from TB_Group_Purchase_Info where id=@id1) set @tempOriginal_Price=(select original_Price from TB_Group_Purchase_Info where id=@id1) set @tempSold=(select sold from TB_Group_Purchase_Info where id=@id1) set @tempGroup_purchase_info_name=(select group_purchase_info_name from TB_Group_Purchase_Info where id=@id1) set @tempCity=(select city from TB_Group_Purchase_Info where id=@id1) set @tempRegion=(select region from TB_Group_Purchase_Info where id=@id1) set @tempStartTime=(select startTime from TB_Group_Purchase_Info where id=@id1) set @tempEndTime=(select endTime from TB_Group_Purchase_Info where id=@id1) set @tempPurchase_type=(select purchase_type from TB_Group_Purchase_Info where id=@id1) --a=b update dbo.TB_Group_Purchase_Info set url=(select url from TB_Group_Purchase_Info where id=@id2), imageUrl=(select imageUrl from TB_Group_Purchase_Info where id=@id2), title=(select title from TB_Group_Purchase_Info where id=@id2), group_purchase_price=(select group_purchase_price from TB_Group_Purchase_Info where id=@id2), discount=(select discount from TB_Group_Purchase_Info where id=@id2), sold=(select sold from TB_Group_Purchase_Info where id=@id2), group_purchase_info_name=(select group_purchase_info_name from TB_Group_Purchase_Info where id=@id2), city=(select city from TB_Group_Purchase_Info where id=@id2), region=(select region from TB_Group_Purchase_Info where id=@id2), startTime=(select startTime from TB_Group_Purchase_Info where id=@id2), endTime=(select endTime from TB_Group_Purchase_Info where id=@id2), purchase_type=(select purchase_type from TB_Group_Purchase_Info where id=@id2) where id=@id1 --b=t update dbo.TB_Group_Purchase_Info set url=@tempUrl, imageUrl=@tempImageUrl, title=@tempTitle, group_purchase_price=@tempGroup_purchase_price, discount=@tempDiscount, original_price=@tempOriginal_Price, sold=@tempSold, group_purchase_info_name=@tempGroup_purchase_info_name, city=@tempCity, region=@tempRegion, startTime=@tempStartTime, endTime=@tempEndTime, purchase_type=@tempPurchase_type where id=@id2 print 'url:'+@tempUrl print 'imageurl:'+@tempImageUrl print 'group_purchase_price:'+@tempGroup_purchase_price print 'discount:'+@tempDiscount print 'original_Price:'+@tempOriginal_Price print 'sold:'+@tempSold print 'group_purchase_info_name:'+@tempGroup_purchase_info_name print 'city:'+@tempCity print 'region:'+@tempRegion print 'startTime:'+@tempStartTime print 'endTime:'+@tempEndTime print 'purchase_type:'+@tempPurchase_type
评论列表
本站所提供的代码,版权归原作者所有,若有侵犯作者版权,请与我们联系,我们将立即删除或修改。谢谢!
本站所有代码发布及提供者。
试试其它关键字
交换数据
同语言下
.
如何固定查询一个时间段的数据
.
合并数据,并以逗号连接数据
.
SQL字符串中只包含或不包含某种字符的方法
.
银行卡类型判断sql
.
生成时间+4位随机号
.
查询上一条,当前一条,下一条的SQL
.
SQL Server 中从完整路径提取文件名
.
查询所有本周,本月的数据
.
SQL重复记录查询
.
SQL server 数据库危险存储过程删除与恢复
可能有用的
.
操作MongoDB数据库并获取数据方法
.
个人邮箱发邮件给多个邮箱
.
python 抓取搜狗指定公众号
.
屏幕中间的弹框列表
.
json下钻函数,解决多层嵌套问题
.
pandas读取指定列
.
队列的顺序存储实现和栈的链式实现
.
多线程(Runtime类、Timer计时器)
.
任意字符串前后互换、100以内素数
.
实现队列的操作
明蔚
贡献的其它代码
(
8
)
.
最大连续和
.
存储过程没有写传出参数如何获取里面的内容
.
Java 子窗口
.
客户端绑定DataView和DataTable的技巧
.
页面多个倒计时
.
如何从元素中除去HTML
.
交换数据
.
判断一个时间点是否位于给定时间区间
地图
本站
我们
服务
版权
联系
回馈
博客