易截截图软件、单文件、免安装、纯绿色、仅160KB

Sql server存储过程中 数据集的缓存

create procedure DeleteWareHouse_StoreArea_SummaryByPUR
(@po_no nvarchar(100))
as
begin
declare @cacheTable table(wh_id int);--声明一个table类型的变量
insert @cacheTable select wh_id from aps_inventory_store_area where description=@po_no--向变量@cacheTable中添加结果集
--select * from @cacheTable
delete aps_inventory_summary where wh_id in(select * from @cacheTable)
delete aps_inventory_store_area where wh_id in(select * from @cacheTable)
delete aps_inventory_warehouse where wh_id in(select * from @cacheTable)
end 


相关文档:

航空公司管理系统(VC++ 与SQL 2005)

系统环境:Windows 7
软件环境:Visual C++ 2008 SP1 +SQL Server 2005
本次目的:编写一个航空管理系统
      这是数据库课程设计的成果,虽然成绩不佳,但是作为我用VC++ 以来编写的最大程序还是传到网上,以供参考。用VC++ 做数据库设计并不容易,但也不是不可能。以下是我的程序界面,后面 ......

SQL语句优化方法

我们要做到不但会写SQL,还要做到写出性能优良的SQL语句。

(1)选择最有效率的表名顺序(只在基于规则的优化器中有效):

Oracle的解析器按照从右到左的顺序处理from子句中的表名,from子句中写在最后的表(基础表 driving table)将被最先处理,在f ......

sql语句中left join、inner join中的on与where的区别

table a(id, type):
id     type 
----------------------------------
1      1         
2      1          
3   &n ......

我想用一条SQL显示这样的结果

不知道这样的要求能不能实现?
比如我有一张表T1,里面只有一个字段1
里面有100条记录,如下所示:
字段1
A1
A2
A3
A4
...
A100
我想用一条SQL显示这样的结果
第一列    第二列    ...        第十列
A1        A11    &nb ......

SQl 语句(常见) 新建,删除,修改表结构

新建表:
create table [表名]
(
[自动编号字段] int IDENTITY (1,1) PRIMARY KEY ,
[字段1] nVarChar(50) default '默认值' null ,
[字段2] ntext null ,
[字段3] datetime,
[字段4] money null ,
[字段5] int default 0,
[字段6] Decimal (12,4) default 0,
[字段7] image null ,
)
删除表:
Drop table [表 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号