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

sql update 用法

将b表中caller列的值插入a表中call列中。
 create table a
(
 fid int,
 call varchar(20),
 age int
)
create table b
(
 fid int,
 caller varchar(20),
 parentId int
)
select * from a
select * from b
insert into a values(1,null,19)
insert into a values(2,null,20)
insert into b values(1,'a',1)
insert into b values(2,'b',2)
update  a set call =b.caller from b inner join a on a.fid = b.parentId


相关文档:

SQL SERVER字段类型说明

 
bit:0或1的整型数字
int:从-2^31(-2,147,483,648)到2^31(2,147,483,647)的整型数字
smallint:从-2^15(-32,768)到2^15(32,767)的整型数字
tinyint:从0到255的整型数字

decimal:从-10^38到10^38-1的定精度与有效位数的数字
numeric:decimal的同义词

money:从-2^63(-922,337,203,685,477.580 ......

ASP.NET和SQL SERVER中使用事务示例

1,SqlServer存储过程的事务处理
一种比较通用的出错处理的模式大概如下:
Create procdure prInsertProducts
(
 @intProductId int,
 @chvProductName varchar(30),
 @intProductCount int
)
AS
Declare @intErrorCode int
Select @intErrorCode=@@Error
Begin transaction
 if @intError ......

用索引提高SQL Server性能

 在微软的SQL Server系统中通过有效的使用索引可以提高数据库的查询性能,但是性能的提高取决于数据库的实现。在本文中将会告诉你如何实现索引并有效的提高数据库的性能。 
  
  在关系型数据库中使用索引能够提高数据库性能,这一点是非常明显的。用的索引越多,从数据库系统中得到数据的速度就越快。然而,需 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号