下一站天后

今朝的容颜老于昨晚

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

随笔分类 -  sql server

摘要:有很多不需要安装。根据自己的需求来,vs2008同理! 阅读全文
posted @ 2009-06-04 11:23 孙雅玲 阅读(192) 评论(0) 推荐(0)

摘要:要使objectId数量最多的排在最前面 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->select objectId,count(*) as statisticNum from statistic group by objectId order ... 阅读全文
posted @ 2009-04-17 14:29 孙雅玲 阅读(365) 评论(0) 推荐(0)

摘要:分页存储过程 阅读全文
posted @ 2009-02-03 09:19 孙雅玲 阅读(391) 评论(1) 推荐(0)

摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> update sacLogin set companyName= room.roomType from saclogin,room where room.port = sacLogin.port ... 阅读全文
posted @ 2008-12-15 14:52 孙雅玲 阅读(348) 评论(0) 推荐(0)

摘要:declare @date datetime select @date = ArtPassDate from QsqArticle where artId = @artId 阅读全文
posted @ 2008-10-09 14:04 孙雅玲 阅读(775) 评论(0) 推荐(0)

摘要: if not exists (select * from QsqPageContent where ObjectID=@ObjectID and ShowType=@ShowType) 阅读全文
posted @ 2008-09-21 20:02 孙雅玲 阅读(930) 评论(0) 推荐(0)

摘要:三、技巧 1、1=1,1=2的使用,在SQL语句组合时用的较多 "where 1=1" 是表示选择全部 "where 1=2"全部不选, 阅读全文
posted @ 2008-09-14 17:10 孙雅玲 阅读(217) 评论(1) 推荐(0)

摘要:Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->ifexists(select*fromdbo.sysobjectswhereid=object_id(N'[dbo].[UP_forums_CodeScheduleType_... 阅读全文
posted @ 2008-09-12 16:40 孙雅玲 阅读(579) 评论(0) 推荐(0)

摘要:还原数据库的时候一定要选对还原路径,以前还原的时候常忘记 还原好了数据库之后,发现日志文件很大,占了好几g,这时可以采用收缩日志文件,将其内容全部清空。 方法:首先》在查询分析器中执行DUMP TRANSACTION 库名 WITH NO_LOG 然后》在企业管理器中》数据库右键》所有任务》收缩数据库》文件》数据库文件(选择要收缩的文件),收缩文件至(这个不用管它)》确定 ... 阅读全文
posted @ 2008-08-27 20:07 孙雅玲 阅读(541) 评论(2) 推荐(0)

摘要:数据库中“时间”,“整数”查询不能模糊查询,只能用“” 例如: select * from expert where beginTime = #2008-9-9# and beginTime #2008-9-10# 阅读全文
posted @ 2008-08-25 15:06 孙雅玲 阅读(3020) 评论(6) 推荐(0)

摘要:在写数据库命令语句时,我们经常会建一个测试表来试验自己写的语句是否正确,这里可以建一个临时表,用完之后自动删除很方便。顺便也学学临时表的用法。 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->create table #test ( id in... 阅读全文
posted @ 2008-08-20 12:55 孙雅玲 阅读(445) 评论(0) 推荐(0)

摘要:case when then代替if else和传多个参数 insert 后直接写select将查询出来的记录添加进去 阅读全文
posted @ 2008-08-19 17:01 孙雅玲 阅读(3249) 评论(0) 推荐(0)