SQL Server版FAQ帖 欢迎大家踊跃补充

CSDN 2012-05-04 02:39:56
加精
感谢大家提供的内容,我们在fredrickhu版主的帖子上进行了一定的补充,希望本帖可以为大家带来帮助,也欢迎各位随时补充。

常见问题
SQL SERVER中一些常见性能问题的总结

行列转换:
http://topic.csdn.net/u/20080614/17/22e73f33-f071-46dc-b9bf-321204b1656f.html(总结帖子)
http://topic.csdn.net/u/20090912/14/25d2e1b2-f352-4713-8618-d3433ba27bef.html(经典帖子)

合并分拆表:
http://topic.csdn.net/u/20080612/22/c850499f-bce3-4877-82d5-af2357857872.html

果果字符串整理系列

处理表重复记录
http://topic.csdn.net/u/20080626/00/43d0d10c-28f1-418d-a05b-663880da278a.html

SSAS系列:
过渡到SSAS之一:简单模型认识
过渡到SSAS之二:服务的发布
和尚翻译的SSRS的帖子

SSIS系列:

小梁系列之SSIS遍历记录查询邮件

小梁系列之SSIS表达式

小梁系列之SSIS “查找组件” 查找范围内的数据

小梁系列之SSIS 同步和异步转换

小梁系列之SSIS中 “条件拆分”组件中 ISNUMERIC的问题

小梁系列之脚本任务中访问记录集RecordSet

小梁系列之SSIS中数据源和数据目标中的”保留空值”


有关SQL注入的帖子:
什么是SQL注入?
SQL注入专题
http://topic.csdn.net/u/20090326/11/5e584897-2dd7-4e10-af1b-9b48b146af8e.html?95281
http://topic.csdn.net/u/20090523/19/72041932-b65c-49c1-ad36-d2c63b38b174.html?96607

经典代码系列:
经典短小代码
第一季
第二季
最近的一个
http://topic.csdn.net/u/20080605/15/ca6b25f3-3e60-4b95-ac7e-7d7dc02354e6.html?87229
T-SQL常见基础疑点问答整理(1)
T-SQL常见基础疑点问答整理(2)


石头系列之2005事务与锁定系列
事务与锁定第一篇
事务与锁定第二篇
事务与锁定第三篇
事务与锁定第四篇
事务与锁定第五篇
事务与锁定第六篇

锁概念以及例程说明
如何避免应用程序中的死锁


石头系列之数据库引擎结构
数据库引擎结构一
数据库引擎结构二
数据库引擎结构三

各种进制的转换:(来自影子)
http://topic.csdn.net/u/20090707/16/9a7b8e46-1467-4373-a195-39d80b826827.html?28501

关于数据库的同步的帖子:
http://topic.csdn.net/u/20080523/11/08e4624a-13d1-4a6c-a9bc-7cfdd721a351.html?4574
http://topic.csdn.net/u/20080801/11/2f79d062-8049-4ade-a884-01dbaa429135.html?63426
http://topic.csdn.net/u/20090520/22/2267467b-0c40-4a5e-8b71-24838be0ff64.html?10943
两台服务器的相互同步


数据的导入导出部分:
CSV文件批量导入数据库
http://topic.csdn.net/u/20091009/11/5f3ebd1a-de5f-4d92-bc76-0f2103a34b5a.html?48287
excel导入SQL
http://topic.csdn.net/u/20090724/00/a479a979-8a20-4abb-a184-8a0ee56608c2.html?86864
BCP:
http://topic.csdn.net/u/20090720/21/b27734aa-c091-4a6b-96db-f234e2699385.html?84209
http://topic.csdn.net/u/20090720/21/b27734aa-c091-4a6b-96db-f234e2699385.html?2600
数据的转移
一个比较巧的导法

数据的分页:
http://topic.csdn.net/u/20090416/02/4e3cb6d6-707a-4f42-b295-3e9fd5df7691.html

SQL查询与性能优化系列:

基于SQL SERVER的查询和优化
提高查询速度的注意事项
SQL查询效率的优化
SQL语句优化汇总
SQL性能优化综述
SQL Server查询优化
SQL优化之执行计划
五种提高SQL性能的方法
SQL开发的二十一条军规
一千万条数据的优化
如何提高sql查询100万条数据count(*)汇总的速度
数据库优化汇总
海量数据库的相关处理

索引系列:
全文索引
查看索引信息/生成创建索引脚本
聚焦索引与非聚焦索引及其查询效率

递归函数系列:
BOM:
其他:
http://topic.csdn.net/u/20090807/08/19f980a3-3830-4261-90ca-0f85ec628492.html

如何判断一个IP地址在一个IP地址段

身份证号码的转化

2005CLR系列:

环比运算
树结构
天气服务

正则表达式

数据库的并发性以及锁相关的帖子:
一个简单的存储过程产生死锁
单条Update语句是否加事务与锁的关系
分析死锁并整理
...全文
20187 177 打赏 收藏 转发到动态 举报
写回复
用AI写文章
177 条回复
切换为时间正序
请发表友善的回复…
发表回复
sysplay 2015-01-19
  • 打赏
  • 举报
回复
先收藏,再慢慢理解。
BiChangQing 2014-11-03
  • 打赏
  • 举报
回复
收藏,慢慢学
janxuan 2014-09-28
  • 打赏
  • 举报
回复
总结的真好,
jxfujuan1985 2014-07-17
  • 打赏
  • 举报
回复
好帖,谢谢楼主分享。
myue 2014-03-27
  • 打赏
  • 举报
回复
好资料,mark一下
a785510512 2014-01-09
  • 打赏
  • 举报
回复
果断留个爪,,然后再看
ChinaITOldMan 2013-12-04
  • 打赏
  • 举报
回复
good post,collect!
flovem_1 2013-11-25
  • 打赏
  • 举报
回复
菜鸟来支持一下
reste51 2013-09-10
  • 打赏
  • 举报
回复
多谢楼主教导,指导了很多
jack_110_jack 2013-09-04
  • 打赏
  • 举报
回复
非常好的,占位中,学习中。。。
---涛声依旧--- 2013-08-28
  • 打赏
  • 举报
回复
--创建取汉字首字母函数(第三版) create function [dbo].[ufn_GetPinYin_V3] ( @col varchar(1000) ) returns varchar(1000) as begin declare @cyc int,@len int,@sql varchar(1000),@char varbinary(20) select @cyc = 1,@len = len(@col),@sql = '' while @cyc <= @len begin select @char = cast(substring(@col, @cyc, 1) as varbinary) declare @maco table (bcode varbinary(20),ecode varbinary(20),letter varchar(10)) insert into @maco select 0XB0A1,0XB0C4,'A' union all select 0XB0C5,0XB2C0,'B' union all select 0XB2C1,0XB4ED,'C' union all select 0XB4EE,0XB6E9,'D' union all select 0XB6EA,0XB7A1,'E' union all select 0XB7A2,0XB8C0,'F' union all select 0XB8C1,0XB9FD,'G' union all select 0XB9FE,0XBBF6,'H' union all select 0XBBF7,0XBFA5,'J' union all select 0XBFA6,0XC0AB,'K' union all select 0XC0AC,0XC2E7,'L' union all select 0XC2E8,0XC4C2,'M' union all select 0XC4C3,0XC5B5,'N' union all select 0XC5B6,0XC5BD,'O' union all select 0XC5BE,0XC6D9,'P' union all select 0XC6DA,0XC8BA,'Q' union all select 0XC8BB,0XC8F5,'R' union all select 0XC8F6,0XCBF9,'S' union all select 0XCBFA,0XCDD9,'T' union all select 0XCDDA,0XCEF3,'W' union all select 0XCEF4,0XD1B8,'X' union all select 0XD1B9,0XD4D0,'Y' union all select 0XD4D1,0XD7F9,'Z' select top 1 @sql=@sql+letter from @maco where @char between bcode and ecode set @cyc = @cyc + 1 end return @sql end GO --创建取汉字首字母函数(第四版) create function [dbo].[ufn_GetPinYin_V4] ( @col varchar(1000) ) returns varchar(1000) begin declare @cyc int,@len int,@sql varchar(1000),@char varbinary(20) select @cyc = 1,@len = len(@col),@sql = '' while @cyc <= @len begin select @char = cast(substring(@col, @cyc, 1) as varbinary) if @char>=0XB0A1 and @char<=0XB0C4 set @sql=@sql+'A' else if @char>=0XB0C5 and @char<=0XB2C0 set @sql=@sql+'B' else if @char>=0XB2C1 and @char<=0XB4ED set @sql=@sql+'C' else if @char>=0XB4EE and @char<=0XB6E9 set @sql=@sql+'D' else if @char>=0XB6EA and @char<=0XB7A1 set @sql=@sql+'E' else if @char>=0XB7A2 and @char<=0XB8C0 set @sql=@sql+'F' else if @char>=0XB8C1 and @char<=0XB9FD set @sql=@sql+'G' else if @char>=0XB9FE and @char<=0XBBF6 set @sql=@sql+'H' else if @char>=0XBBF7 and @char<=0XBFA5 set @sql=@sql+'J' else if @char>=0XBFA6 and @char<=0XC0AB set @sql=@sql+'K' else if @char>=0XC0AC and @char<=0XC2E7 set @sql=@sql+'L' else if @char>=0XC2E8 and @char<=0XC4C2 set @sql=@sql+'M' else if @char>=0XC4C3 and @char<=0XC5B5 set @sql=@sql+'N' else if @char>=0XC5B6 and @char<=0XC5BD set @sql=@sql+'O' else if @char>=0XC5BE and @char<=0XC6D9 set @sql=@sql+'P' else if @char>=0XC6DA and @char<=0XC8BA set @sql=@sql+'Q' else if @char>=0XC8BB and @char<=0XC8F5 set @sql=@sql+'R' else if @char>=0XC8F6 and @char<=0XCBF9 set @sql=@sql+'S' else if @char>=0XCBFA and @char<=0XCDD9 set @sql=@sql+'T' else if @char>=0XCDDA and @char<=0XCEF3 set @sql=@sql+'W' else if @char>=0XCEF4 and @char<=0XD1B8 set @sql=@sql+'X' else if @char>=0XD1B9 and @char<=0XD4D0 set @sql=@sql+'Y' else if @char>=0XD4D1 and @char<=0XD7F9 set @sql=@sql+'Z' set @cyc = @cyc + 1 end return @sql end GO
---涛声依旧--- 2013-08-28
  • 打赏
  • 举报
回复
--创建取汉字首字母函数(第二版) create function [dbo].[ufn_GetPinYin_V2](@Str varchar(500)='') returns varchar(500) as begin declare @strlen int,@return varchar(500),@ii int declare @n int,@c char(1),@chn nchar(1) select @strlen=len(@str),@return='',@ii=0 set @ii=0 while @ii<@strlen begin select @ii=@ii+1,@n=63,@chn=substring(@str,@ii,1) if @chn>'z' select @n = @n +1 ,@c = case chn when @chn then char(@n) else @c end from( select top 27 * from ( select chn = '吖' union all select '八' union all select '嚓' union all select '咑' union all select '妸' union all select '发' union all select '旮' union all select '铪' union all select '丌' --because have no 'i' union all select '丌' union all select '咔' union all select '垃' union all select '嘸' union all select '拏' union all select '噢' union all select '妑' union all select '七' union all select '呥' union all select '仨' union all select '他' union all select '屲' --no 'u' union all select '屲' --no 'v' union all select '屲' union all select '夕' union all select '丫' union all select '帀' union all select @chn) as a order by chn COLLATE Chinese_PRC_CI_AS ) as b else set @c='a' set @return=@return+@c end return(@return) end GO
---涛声依旧--- 2013-08-28
  • 打赏
  • 举报
回复
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO --创建取汉字首字母函数(第一版) create function [dbo].[ufn_GetPinYin_V1] (@str nvarchar(4000)) returns nvarchar(4000) as begin declare @word nchar(1),@py nvarchar(4000) set @py='' while len(@str)>0 begin set @word=left(@str,1) set @py = @py+ (case when unicode(@word) between 19968 and 19968+20901 then ( select top 1 py from ( select 'a' as py, N'驁' as word union all select 'B',N'簿' union all select 'C',N'錯' union all select 'D',N'鵽' union all select 'E',N'樲' union all select 'F',N'鰒' union all select 'G',N'腂' union all select 'H',N'夻' union all select 'J',N'攈' union all select 'K',N'穒' union all select 'L',N'鱳' union all select 'M',N'旀' union all select 'N',N'桛' union all select 'O',N'漚' union all select 'P',N'曝' union all select 'Q',N'囕' union all select 'R',N'鶸' union all select 'S',N'蜶' union all select 'T',N'籜' union all select 'W',N'鶩' union all select 'X',N'鑂' union all select 'Y',N'韻' union all select 'Z',N'咗' ) T where word>=@word collate Chinese_PRC_CS_AS_KS_WS order by py asc ) else @word end) set @str=right(@str,len(@str)-1) end return @PY end GO
eOuch 2013-08-09
  • 打赏
  • 举报
回复
iig1023 2013-07-23
  • 打赏
  • 举报
回复
好的东西要支持
单程登车 2013-07-03
  • 打赏
  • 举报
回复
非常好,学习学习
会飞的鱼1 2013-07-02
  • 打赏
  • 举报
回复
收到收到顶起
sunxi728496 2013-06-13
  • 打赏
  • 举报
回复
没看什么东东,就觉得很牛耶
sunxi728496 2013-06-13
  • 打赏
  • 举报
回复
没看什么东东,就觉得很牛耶
ti69000 2013-06-13
  • 打赏
  • 举报
回复
非常实用,学习一下。
加载更多回复(153)

11,849

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 非技术版
社区管理员
  • 非技术版社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧