代码语言
.
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
/
1058
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 如何去除重复的字符串
.
怎么去掉一个字段中的重复数据
.
String 去除空格 回车 换行 水平制表符
.
SQL查询和替换含有回车,空格,TAB
.
SQL SERVER 查询每日新增用户数量、次留数量
.
判断两个字符串是否存在相同的内容
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
明蔚
贡献的其它代码
(
9
)
.
JAVA生成指定位数不重复的随机数,随机数含0-9、A-Z
.
最大连续和
.
存储过程没有写传出参数如何获取里面的内容
.
Java 子窗口
.
客户端绑定DataView和DataTable的技巧
.
页面多个倒计时
.
如何从元素中除去HTML
.
交换数据
.
判断一个时间点是否位于给定时间区间
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3