2019年1月22日
摘要: SSIS导入Excel时记录行号 1. "Excel源"后添加"脚本组件" 2. "脚本组件"中新增输出列,命名为"RowNumber" 3."脚本组件"中编辑脚本. 4. 脚本如下. private int m_rowNumber; m_rowNumber++; Row.RowNumber = m_rowNumber; 5. 下一... 阅读全文
posted @ 2019-01-22 21:52 天空一角 阅读(875) 评论(0) 推荐(1) 编辑
  2011年4月22日
摘要: 编写一个简单的“Hello World”存储过程 将以下 Visual C# 代码复制并粘贴到一个文本编辑器中,然后在名为“helloworld.cs”的文件中保存它。 using System;us... 阅读全文
posted @ 2011-04-22 13:49 天空一角 阅读(481) 评论(0) 推荐(0) 编辑
摘要: 假设有表table_info的师徒包含table_name,row_count等字段,需要查询那些表的记录数小余100行?那些表的记录数在100到10000行之间?那些表的记录数在10000到100... 阅读全文
posted @ 2011-04-22 10:39 天空一角 阅读(263) 评论(0) 推荐(0) 编辑
  2011年4月21日
摘要: 测试数据 create table movies --电影表(movie_id int, --电影ID actors varchar(50)) --演员IDgoinsert into movies ... 阅读全文
posted @ 2011-04-21 17:54 天空一角 阅读(428) 评论(0) 推荐(0) 编辑
摘要: 一.创建枢轴表 1.单个CTE 测试返回一千万行记录表的时间为2:19,最简单的写法,测试结果显示效率最低 declare @n bigintset @n=10000000;with number ... 阅读全文
posted @ 2011-04-21 16:08 天空一角 阅读(354) 评论(0) 推荐(0) 编辑
  2011年4月19日
摘要: 判断操作类型 if exists (select 1 from inserted) and exists (select 1 from deleted)begin -- updateendif exists (select 1 from inserted) and not exists (selec... 阅读全文
posted @ 2011-04-19 12:05 天空一角 阅读(406) 评论(0) 推荐(0) 编辑
  2011年1月12日
摘要: 方法一: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 select * 2 fro... 阅读全文
posted @ 2011-01-12 10:39 天空一角 阅读(856) 评论(0) 推荐(0) 编辑
  2010年7月12日
摘要: 数据库层面优化解决思路: 当出现SQL查询比较慢问题 在数据库层面,优化方法一般采用,减少访问次数,高效SQL,建立索引和建立表分区,好的数据库表设计。 情况一:一个功能执行很慢,通过SQL Profile取出SQL语句。如果查看sql的各个表,如果查询的表的数据量在5万以下, 1,看该查询sq... 阅读全文
posted @ 2010-07-12 16:52 天空一角 阅读(1211) 评论(0) 推荐(0) 编辑
  2010年6月4日
摘要: 在SQL Server中利用 FOR XML PATH 语句能够把查询的数据生成XML数据,下面是它的一些应用示例。 DECLARE @TempTable table(UserID int , UserName nvarchar(50)); insert into @TempTable (UserI 阅读全文
posted @ 2010-06-04 14:22 天空一角 阅读(17401) 评论(16) 推荐(8) 编辑
  2010年5月19日
摘要: execsp_spaceused'表名'(SQL统计数据,大量事务操作后可能不准) execsp_spaceused'表名',true(更新表的空间大小,准确的表空大小,但可能会花些统计时间) execsp_spaceused(数据库大小查询) execsp_MSforeachtable"execs... 阅读全文
posted @ 2010-05-19 15:43 天空一角 阅读(550) 评论(0) 推荐(0) 编辑