易截截图软件、单文件、免安装、纯绿色、仅160KB

SqlServer中自定义类似Split截取字段函数

if exists (select * from dbo.sysobjects where name='SplitStr' )
drop FUNCTION SplitStr
go
CREATE   FUNCTION   SplitStr   (@splitString   varchar(8000),   @separate   varchar(10))  
RETURNS   @returnTable   table(col_Value   varchar(20))  
AS  
BEGIN  
declare   @thisSplitStr   varchar(20)  
declare   @thisSepIndex   int  
declare   @lastSepIndex   int  
set   @lastSepIndex   =   0  
if   Right(@splitString   ,len(@separate))   <>   @separate   set   @splitString   =   @splitString   +   @separate  
set   @thisSepIndex   =   CharIndex(@separate,@splitString   ,@lastSepIndex)  
while   @lastSepIndex   <=   @thisSepIndex  
begin  
                set   @thisSplitStr   =   SubString(@splitString   ,@lastSepIndex,@thisSepIndex-@lastSepIndex)  
                set   @lastSepIndex   =   @thisSepIndex   +   1  
                set   @thisSepIndex   =   CharIndex(@separate,@splitString   ,@lastSepIndex)  
                insert   into   @returnTable   values(@thisSplitStr)  
end&n


相关文档:

sqlserver 跨库拷贝数据


Create Procedure up_InsertData2
@ID INT
AS
BEGIN
Declare @Name NVARCHAR(30)
Declare @c1 NVARCHAR(30)
Declare @c2 NVARCHAR(30)
Declare @c3 NVARCHAR(30)
Declare @c4 NVARCHAR(30)
Declare tmpCur Cursor For Select a,b,c,d from  table1
Open tmpCur;
Fetch Next from tmpCur Into @c1,@c2,@c3 ......

为SQLServer表中的字段添加说明

在SQL语句中通过系统存储过sp_addextendedproperty可为表字段添加上动态的说明(备注)下面是SQL SERVER帮助文档中对sp_addextendedproperty存储过程的描述
语法
sp_addextendedproperty
    [ @name = ] { 'property_name' }
    [ , [ @value = ] { 'value' }
   &nbs ......

如何解决SQLServer占内存过多的问题

  经常看见有人问,MSSQL占用了太多的内存,而且还不断的增长;或者说已经设置了使用内存,可是它没有用到那么多,这是怎么一回事儿呢?
  首先,我们来看看MSSQL是怎样使用内存的。
  最大的开销一般是用于数据缓存,如果内存足够,它会把用过的数据和觉得你会用到的数据统统扔到内存中,直到内存不足的时候 ......

Oracle中与SQLSERVER ISNULL函数相同作用的函数

NVL(Expr1,Expr2)如果Expr1为NULL,返回Expr2的值,否则返回Expr1的值
NVL2(Expr1,Expr2,Expr3)如果Expr1为NULL,返回Expr2的值,否则返回Expr3的值
NULLIF(Expr1,Expr2)如果Expr1和Expr2的值相等,返回NULL,否则返回Expr1的值 ......

C#读取sqlserver 动画flash swf 文件到本地硬盘

 using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlC ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号