导航

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 35 下一页

2014年4月3日

摘要: 比如做一个学生选课系统 数据库有3张表 students(ID,Name,Age) ,courses(ID,Name),selectedcourses(studentID,courseID)括号里是字段。下面是存储过程 根据传来的学生姓名以及选课构成的字符串,保存数据@name nvarchar(50),@age int,@text nvarchar(50),-- 比如@text='1|4|15|'ASbegin declare @tmp nvarchar(50) declare @stuid int declare @i int declare ... 阅读全文

posted @ 2014-04-03 04:05 beeone 阅读(2088) 评论(0) 推荐(0)

摘要: Create proc procedureName @orderId int ,@name varchar(20) ,@count intasbegin Declare @id int declare @tb table(postid int) BEGIN TRANSACTION insert into A value(@orderId) Select @id=@@identity SET @count = 0 SELECT @count = count(*) FROM dbo.f_split('A,B,C,D,E',',') ... 阅读全文

posted @ 2014-04-03 03:43 beeone 阅读(265) 评论(0) 推荐(0)

2014年3月29日

摘要: 语法:alter table alter column 新类型名(长度)示例:假如有名T1,字段名F1,原来F1为varchar(3),现在要改为varchar(10),则可以这么写:alter table T1 alter column F1 varchar(10) 阅读全文

posted @ 2014-03-29 09:34 beeone 阅读(375) 评论(0) 推荐(0)

2014年3月26日

摘要: asp.net Repeater控件的使用方法2011-11-28 22:09 4770人阅读 评论(1) 收藏 举报asp.netserveraspdatasetdeletexhtml今天学习了,Repeater控件repeater绑定数据: protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) BindStudent(); } private void BindStudent() { string str = Configura... 阅读全文

posted @ 2014-03-26 06:30 beeone 阅读(344) 评论(0) 推荐(0)

2014年3月25日

摘要: EXEC sp_addlinkedserver @server='serverA', @srvproduct='', @provider='SQLOLEDB', @datasrc='192.168.0.28'EXEC sp_addlinkedsrvlogin @rmtsrvname='serverA', @useself='false', @rmtuser ='sa',@rmtpassword = 'aaa' 阿乌(185940804) 10:49:20去网上找找! 阅读全文

posted @ 2014-03-25 21:20 beeone 阅读(316) 评论(0) 推荐(0)

摘要: create table t(name varchar(03),subject varchar(10),mark int)insert into tselect 'A','語文',80 union allselect 'A','數學',80 union allselect 'A','外語',80 union allselect 'B','數學',80 union allselect 'B','外語',80 union allselect 阅读全文

posted @ 2014-03-25 21:14 beeone 阅读(2456) 评论(0) 推荐(0)

摘要: EXEC sp_dboption 'my', 'Single User', 'TRUE' EXEC sp_renamedb 'my', 'mycrjtest' EXEC sp_dboption 'mycrjtest', 'Single User', 'FALSE' 阅读全文

posted @ 2014-03-25 21:09 beeone 阅读(184) 评论(0) 推荐(0)

摘要: 动态sql语句基本语法 1 :普通SQL语句可以用Exec执行 eg: Select * from tableName Exec('select * from tableName') Exec sp_executesql N'select * from tableName' -- 请注意字符串前一定要加N 2:字段名,表名,数据库名之类作为变量时,必须用动态SQL eg: declare @fname varchar(20) set @fname = 'FiledName' Select @fname from tableName ... 阅读全文

posted @ 2014-03-25 21:07 beeone 阅读(515) 评论(0) 推荐(0)

摘要: --得出以上速度的方法是:在各个select语句前加:declare @d datetimeset @d=getdate()select * from tb--并在select语句后加:select [语句执行花费时间(毫秒)]=datediff(ms,@d,getdate())CREATE TABLE [dbo].[TGongwen] ( --TGongwen是红头文件表名[Gid] [int] IDENTITY (1, 1) NOT NULL ,--本表的id号,也是主键[title] [varchar] (80) COLLATE Chinese_PRC_CI_AS NULL , --红头 阅读全文

posted @ 2014-03-25 20:52 beeone 阅读(2212) 评论(0) 推荐(0)

摘要: public void BindTree(TreeView tview, TreeNode tn_main, string parentId,string sql) { TreeNode tn=null; tview.Font.Size = FontUnit.Small; tview.ForeColor = System.Drawing.Color.Black; DB db = new DB(); ... 阅读全文

posted @ 2014-03-25 20:01 beeone 阅读(377) 评论(0) 推荐(0)

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 35 下一页