yueyue, I have fallen in love with you for

2011-02-09, 01:18:25 PM

2011年8月14日

摘要: 开始事物:begin transaction提交事物:commit transaction回滚事物:rollback transaction例子:begin transactiondeclare @errorSum int --定义局部变量set @errorSum=0 --初始化临时变量update bank set currentMoney=currentMoney-1000 where customerName='张三'set @errorSum=@errorSum+@@error --累计是否有错误update bank set currentMoney=current 阅读全文

posted @ 2011-08-14 23:16 张超的博客 阅读(266) 评论(0) 推荐(0)

摘要: USE [MySchool]GO/****** Object: StoredProcedure [dbo].[usp_addscore] Script Date: 01/19/2011 14:29:46 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO-- =============================================-- Author:<Author,,Name>-- Create date: <Create Date,,>-- Description:<Description, 阅读全文

posted @ 2011-08-14 22:44 张超的博客 阅读(226) 评论(0) 推荐(0)

摘要: <frameset rows="200px,*,200px"><!--*代表剩下的部分--><frame src="../a.html"></frame><frameset cols="200px,*"><frame src="../a.html"></frame><frame name="singFrame" src="sing.htm"></frame></f 阅读全文

posted @ 2011-08-14 20:33 张超的博客 阅读(189) 评论(0) 推荐(0)

摘要: if (条件) begin 语句1语句2 endelsebegin 语句1语句2 end例子:declare @n intwhere (1=1)begin select @n=count(*) from stuMarks where writtenExam<60if (@n>0)updateelse[break]从内层的while循环中退出 阅读全文

posted @ 2011-08-14 20:26 张超的博客 阅读(257) 评论(0) 推荐(0)

摘要: USE mastergoif exists(select * from sysdatabases where name='stuDB')drop database stuDBcreate database stuDBon primary --默认主文件组(name='stuDB_data',filename='D:\project\stuDB_data.mdf',size=5mb,maxsize=100mb,filegrowth=15%)log on(name='stuDB_log',filename='D:\projec 阅读全文

posted @ 2011-08-14 20:13 张超的博客 阅读(180) 评论(0) 推荐(0)

摘要: --添加主键约束:(将stuNo作为主键)Alter Table stuInfoADD Constraint PK_stuNo Primary key(stuNo)--添加唯一约束(身份证号唯一,以为每个人的身份证号是唯一的)Alter Table stuInfoADD Constraint UQ_stuID Primary key(stuID)--添加默认约束(如果地址不详,默认为“地址不详”)Alter Table stuInfoADD Constraint DF_stuAddress default('地址不详') for stuAddress--添加检查约束,要求年龄只 阅读全文

posted @ 2011-08-14 19:55 张超的博客 阅读(260) 评论(0) 推荐(0)


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3