随笔分类 -  SQL SERVER

摘要:把你目前查到结果集定义为一个临时表 tempTable下面是如何查 SELECT * FROM tempTable where 关键字=‘’举例select book_num,book_name,book_type from(select * from bookinfo ) as temptable where book_num=2 阅读全文
posted @ 2013-08-21 10:37 Follow-your-heart
摘要:1 using System; 2 using System.Collections.Generic; 3 using System.Configuration; 4 using System.Web.Configuration; 5 using System.Text; 6 using System.IO; 7 8 /// 9 /// SystemConfig 的摘要说明 10 /// 11 public static class SystemConfig12 {13 private static Configuration ConfigFile;14 pr... 阅读全文
posted @ 2013-07-11 10:57 Follow-your-heart 阅读(318) 评论(0) 推荐(0)
摘要:获取数据库中所有的表SELECT SysObjects.name AS Tablename FROM sysobjects WHERE xtype = 'U'获取数据库中所有表的列名SELECT SysColumns.name AS Columnsname, SysObjects.name AS Tablename FROM SysObjects, SysColumns WHERE Sysobjects.Xtype='u' AND Sysobjects.Id=Syscolumns.Id获取SqlServer中的所有数据库,系统数据库除外Select name f 阅读全文
posted @ 2013-06-28 11:15 Follow-your-heart
摘要:创建存储过程: 1 create procedure houseCount 2 ( 3 @house_state nvarchar(20), 4 @house_count int output 5 ) 6 as 7 select @house_count=COUNT(*) from house where house_state=@house_state 8 9 sql执行存储过程:10 declare @house_count int11 execute houseCount '空房',@house_count output select @house_countC#调用存储 阅读全文
posted @ 2013-06-17 16:23 Follow-your-heart
摘要:Bit类型由于只有0和1或者说false和true,它可以用在GridView和CheckBoxField,可以所说是麻雀虽小五脏俱全。 阅读全文
posted @ 2013-04-26 16:11 Follow-your-heart 阅读(1143) 评论(0) 推荐(2)