sqlserver 2005 split function
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
create function [dbo].[split](@str nvarchar(1000),@word varchar(5),@no
int) returns nvarchar(500)
as begin
declare @len int
declare @index int
set @index=charindex(@word,@str)
set @index=len(@word)+@index-1
set @len=len(@str)
if @index >0 and @no=2
return substring(@str,@index+1,@len)
else if @index>0 and @no=1
return substring(@str,0,@index-len(@word)+1)
return @str
end
相关文档:
/*
*SQLServer添加操作实现
*/
void CMFCSQLDlg::OnButton2()
{
// TODO: Add your control notification handler code here
CString strsql;
CString strnum="mynum3";
CString strage="myage3";
HRESULT hResult;
_variant_t RecordsAffected;
CoInitialize(NULL);
_ConnectionPtr m_pAppConn;
hResul ......
游标操作的六步骤:
◆在每次在创建游标的时候都问问自己,用什么别的方法可以避免使用游标,那么你就步如设计的正规了.
1.声明
2.打开
3.应用/操作
4.关闭.
5.释放
&nbs ......
1
.绝对值
S:
select
abs
(
-
1
) value
O:
select
abs
(
-
1
) value
from
dual
2
.取整(大)
S:
select
ceiling
(
-
1.001
) value
O:
select
ceil(
-
1.001
) value
from
d ......
最近因为要写一个数据并发访问的控制程序,上网查了一些资料,现在归纳如下: 锁的概述 一. 为什么要引入锁
多个用户同时对数据库的并发操作时会带来以下数据不一致的问题:
丢失更新
A,B两个用户读同一数据并进行修改,其中一个用户的修改结果破坏了另一个修改的结 ......
现象:
现在做一个程序,对数据库的几个装有大量数据的表进行操作,对其中的一个表进行
循环操作,以处理其他的几个表。其中用到了几个query,update,当程序跑的过程中,
SQLSERVER的内存不断的增长,跑完后关闭程序退出后也不降下来。
解决:
这是SQL的内存管理机制决定的,SQL管理内存的原则是这样的,只要你的内存够 ......