04 2015 档案

摘要:--事物:保障整个流程的完整执行,全部没有问题统一提交,一旦有问题,回到原点--存储过程或者触发器里面用begin tran--事务的开始--开始写流程语句--语句写完之后if @@ERROR>0rollback--回滚事务elsecommit tran--提交事务-----------------... 阅读全文
posted @ 2015-04-29 16:01 Yusarin 阅读(648) 评论(0) 推荐(0)
摘要:--触发器:触发器就是一种特殊的存储过程,只用来“增删改”--触发器特殊的地方就在于,触发器是通过对数据库表的操作,来引发--存储过程是通过人为exec来执行select *from Studentcreate trigger Student_Insert --创建触发器on Student --指... 阅读全文
posted @ 2015-04-29 11:25 Yusarin 阅读(957) 评论(0) 推荐(0)
摘要:--备份:在不影响数据库正常运行情况下,将数据备份到一个.bak结尾的文件--还原:将.bak文件还原到数据库--分离:将数据库与数据库服务进行分离--附加:将数据库.mdf文件,附加到数据库服务上 阅读全文
posted @ 2015-04-28 10:00 Yusarin 阅读(314) 评论(0) 推荐(0)
摘要:--约束:对列的数据值起一个约束的作用,规定列的值的范围--主键,外键,非空,自增长,唯一列unique(name,value),check约束 阅读全文
posted @ 2015-04-28 09:56 Yusarin 阅读(269) 评论(0) 推荐(0)
摘要:--视图,视图就是一个虚拟的表,只能查询,不能修改!只能用作查询!select *from View_1 --显示101这个学生的学生sno,sname,cno,degreecreate view view 2as select Student.Sno,sname,cno,DEGREE from... 阅读全文
posted @ 2015-04-28 09:38 Yusarin 阅读(656) 评论(0) 推荐(0)
摘要:--至查询student表的第3、4行--分页查询 ★必须要用主键Sno来排除,防止重复select *from Studentselect top 2 *from Student where Sno not in(select top 2 Sno from Student)--第二页,屏蔽掉当前页... 阅读全文
posted @ 2015-04-27 16:51 Yusarin 阅读(276) 评论(0) 推荐(0)
摘要:create table 仓库表( 仓库号 varchar(50) primary key not null, 城市 varchar(50) not null, 面积 int not null,)insert into 仓库表 values ('wh1','北京',370)insert into... 阅读全文
posted @ 2015-04-27 10:43 Yusarin 阅读(1342) 评论(0) 推荐(0)
摘要:create proc 存储过程名--输入参数;当调用存储过程时,所需要输入的数据--输出参数,从存储过程中赋值后带出数据as --存储过程内容 return 返回值goexce 返回值=存储过程名称 参数一,参数二,..,参数N--存储过程:相当于C#的函数--定义变量declare ... 阅读全文
posted @ 2015-04-27 10:42 Yusarin 阅读(313) 评论(0) 推荐(0)
摘要:create database 进出货存储过程gouse 进出货存储过程go--水果表create table Fruit( Ids varchar(50) primary key, [Name] varchar(50) not null, Price decimal(8,2), ... 阅读全文
posted @ 2015-04-27 10:41 Yusarin 阅读(429) 评论(0) 推荐(0)
摘要:数据库只是一个工具 简写:SSMS 全拼:SQL Server Management Studio服务器名称: 数据库服务所在的电脑的ip地址 通过".(本台)","lacal(本地)"登陆点击电脑开始→ 运行→ cmd→ net start mssqlserver 服务器的启动 net... 阅读全文
posted @ 2015-04-25 20:48 Yusarin 阅读(249) 评论(0) 推荐(0)
摘要:create table Student--3rd再次执行( Sno int primary key not null,--学号主键 Sname varchar(50) not null,--学生姓名 Ssex varchar(50) not null,--学生性别 Sbirthda... 阅读全文
posted @ 2015-04-25 20:48 Yusarin 阅读(9729) 评论(0) 推荐(1)
摘要:namespace ConsoleApplication10{ class Program { public double[] paixu(double[] a) { double temp; for (in... 阅读全文
posted @ 2015-04-19 16:56 Yusarin 阅读(249) 评论(0) 推荐(0)
摘要:namespace 一元二次方程函数解决{ class Program { static void Main(string[] args) { while (true) { ... 阅读全文
posted @ 2015-04-19 16:54 Yusarin 阅读(374) 评论(0) 推荐(0)
摘要:法1namespace 函数数组排序带出最大最小值及平均值{ class Program { static void Main(string[] args) { int[] b=new int[]{9,1,5,3,7}; ... 阅读全文
posted @ 2015-04-19 16:53 Yusarin 阅读(812) 评论(0) 推荐(0)
摘要:namespace 赶羊递归 { class Program { public int jisuan(int day) //创建一个函数,输入day计算出羊的总数 { int sum=0; ... 阅读全文
posted @ 2015-04-19 16:51 Yusarin 阅读(108) 评论(0) 推荐(0)
摘要:namespace ConsoleApplication1{ class Program { struct huiyuan { public string name; public string password; ... 阅读全文
posted @ 2015-04-19 16:49 Yusarin 阅读(244) 评论(0) 推荐(0)
摘要:自己简单版:namespace ConsoleApplication25{ class Program { struct player { public string name; public int hp,... 阅读全文
posted @ 2015-04-19 16:48 Yusarin 阅读(189) 评论(0) 推荐(0)
摘要:namespace ConsoleApplication30{ class Program { struct buy { public string name; public double prc; ... 阅读全文
posted @ 2015-04-19 16:44 Yusarin 阅读(281) 评论(0) 推荐(0)
摘要:多个箱子:namespace ConsoleApplication1{ class Program { private static void ditu(int[, ,] dt, int i) { for (int j = 0; j < ... 阅读全文
posted @ 2015-04-19 16:40 Yusarin 阅读(584) 评论(0) 推荐(0)
摘要:namespace ConsoleApplication1{ class Program { struct xs { public string name; public double shuxue; ... 阅读全文
posted @ 2015-04-19 16:37 Yusarin 阅读(211) 评论(0) 推荐(0)
摘要:namespace ConsoleApplication22{ class Program { struct s { public string name; public int age; } ... 阅读全文
posted @ 2015-04-19 16:34 Yusarin 阅读(271) 评论(0) 推荐(0)
摘要:static void Main(string[] args) { while (true) { /* string x; Console.WriteLine("请随便输入:"); ... 阅读全文
posted @ 2015-04-19 15:07 Yusarin 阅读(128) 评论(0) 推荐(0)
摘要:(一)数学类:Math1.Math.Ceiling(小数/整数):返回大于当前小数的最小整数2.Math.Floor(小数/整数):返回小于当前小数的最大整数Console.WriteLine(Math.Ceiling(3.14)); //4Console.WriteLine(Math.Floor... 阅读全文
posted @ 2015-04-19 14:58 Yusarin 阅读(202) 评论(0) 推荐(0)
摘要:for (int i = 1; i < =n-1; i++)////n个数需要循环n-1趟 , 每一趟都会找出最小的那个数 { for (int j = 1; j < =n-i; j++)// 每一趟都要n-i次,即俩俩调换的次数 ... 阅读全文
posted @ 2015-04-19 09:51 Yusarin 阅读(135) 评论(0) 推荐(0)
摘要:create database s2015041--创建数据库drop database XXXXXX--删除数据库use master--使用master数据库go--语句与语句的链接符号create table abb( code int not null,--列 name varchar(... 阅读全文
posted @ 2015-04-19 09:14 Yusarin 阅读(155) 评论(0) 推荐(0)
摘要:namespace ConsoleApplication15//推箱子本质就是变量的相互替换,3个变量的循环赋值{ class Program { static void Main(string[] args) { ... 阅读全文
posted @ 2015-04-07 15:32 Yusarin 阅读(1553) 评论(0) 推荐(0)
摘要:namespace ConsoleApplication18{ class Program { static void Main(string[] args) { ArrayList al = new ArrayList(); ... 阅读全文
posted @ 2015-04-07 15:31 Yusarin 阅读(176) 评论(0) 推荐(0)
摘要:namespace ConsoleApplication1{ class Program { static void Main(string[] args) { int count = 0; Console.Writ... 阅读全文
posted @ 2015-04-07 15:30 Yusarin 阅读(254) 评论(0) 推荐(0)
摘要:namespace ConsoleApplication9{ class Program { static void Main(string[] args) { string[,,] a=new string[2,2,3]; ... 阅读全文
posted @ 2015-04-03 11:53 Yusarin 阅读(513) 评论(0) 推荐(0)
摘要:namespace ConsoleApplication10{ class Program { static void Main(string[] args) { double[] a = new double[10];新建一个10个数的... 阅读全文
posted @ 2015-04-03 11:52 Yusarin 阅读(391) 评论(0) 推荐(0)
摘要:namespace ConsoleApplication2{ class Program { static void Main(string[] args) { while (true) { ... 阅读全文
posted @ 2015-04-03 08:50 Yusarin 阅读(501) 评论(0) 推荐(0)
摘要:namespace ConsoleApplication3{ class Program { static void Main(string[] args) { string a=Console.ReadLine(... 阅读全文
posted @ 2015-04-03 08:48 Yusarin 阅读(125) 评论(0) 推荐(0)
摘要:namespace ConsoleApplication5{ class Program { static void Main(string[] args) { while (true) { s... 阅读全文
posted @ 2015-04-03 08:47 Yusarin 阅读(4562) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication8{ class Program { static void Main(string[] ... 阅读全文
posted @ 2015-04-03 08:46 Yusarin 阅读(206) 评论(0) 推荐(0)
摘要:namespace ConsoleApplication7{ class Program { static void Main(string[] args) { DateTime a = DateTime.Now;//定义一个新datet... 阅读全文
posted @ 2015-04-03 08:45 Yusarin 阅读(206) 评论(0) 推荐(0)
摘要:static void Main(string[] args) { int n = 0; while (n<100)// 类比 for(n=0,n<100,n++) { n++; if (n %2==0) { Console.Write(n+"是偶数"... 阅读全文
posted @ 2015-04-01 16:09 Yusarin 阅读(342) 评论(0) 推荐(0)
摘要:namespace ConsoleApplication40{ class Program { static void Main(string[] args) { while (true) { ... 阅读全文
posted @ 2015-04-01 16:08 Yusarin 阅读(179) 评论(0) 推荐(0)
摘要:namespace ConsoleApplication39{ class Program { static void Main(string[] args) { while (true) { ... 阅读全文
posted @ 2015-04-01 16:07 Yusarin 阅读(283) 评论(0) 推荐(0)