Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

mssql Öн«ºº×Öת»»ÎªÆ´ÒôÊ××Öĸ·½·¨


1.
--½«ºº×Öת»»ÎªÆ´ÒôÊ××Öĸ
CREATE   function   GetAllPY(@str   nvarchar(4000))
returns   nvarchar(4000)
--WITH   ENCRYPTION
as
begin
declare   @intLen int
declare   @strRet nvarchar(4000)
declare   @temp   nvarchar(100)
set   @intLen   =   len(@str)
set   @strRet   =   ''
while   @intLen   >   0
begin
set   @temp   =   ''
select   @temp   =   case   
when   substring(@str,@intLen,1)   >=   '帀'   then   'Z'
when   substring(@str,@intLen,1)   >=   'Ѿ'   then   'Y'
when   substring(@str,@intLen,1)   >=   'Ϧ'   then   'X'
when   substring(@str,@intLen,1)   >=   '屲'   then   'W'
when   substring(@str,@intLen,1)   >=   'Ëû'   then   'T'
when   substring(@str,@intLen,1)   >=   'Øí'   then   'S'
when   substring(@str,@intLen,1)   >=   '呥'   then   'R'
when   substring(@str,@intLen,1)   >=   'Æß'   then   'Q'
when   substring(@str,@intLen,1)   >=   '妑'   then   'P'
when   substring(@str,@intLen,1)   >=   'àÞ'   then   'O'
when   substring(@str,@intLen,1)   >=   '拏'   then   'N'
when   substring(@str,@intLen,1)   >=   '嘸'   then   'M'
when   substring(@str,@intLen,1)   >=   'À¬'   then   'L'
when   substring(@str,@intLen,1)   >=   'ßÇ'   then   'K'
when   substring(@str,@intLen,1)   >=   'Ø¢'   then     'J'
when   substring(@str,@intLen,1)   >=   'îþ'   then   'H'
when   substring(@str,@intLen,1)   >=   'ê


Ïà¹ØÎĵµ£º

MsSql ²é¿´ÐÅÏ¢ºÃÓï¾ä

set statistics profile on
set statistics io on
set statistics time on
select top 1 * from et_order order by pkid desc
½á¹ûÈçÏ£º
SQL Server ·ÖÎöºÍ±àÒëʱ¼ä:
   CPU ʱ¼ä = 0 ºÁÃ룬ռÓÃʱ¼ä = 1 ºÁÃë¡£
SQL Server Ö´ÐÐʱ¼ä:
   CPU ʱ¼ä = 0 ºÁÃ룬ռÓÃʱ¼ä = 1 ºÁÃë¡£
SQL Se ......

mssqlÖÐÓÃxmlµÄ·½·¨²ð·ÖÒÔ²»¶¨¿Õ¸ñΪ·Ö¸î·ûºÅµÄ×Ö·û´®

---xml²ð·ÖÒÔ²»¶¨¿Õ¸ñΪ·Ö¸î·ûºÅµÄ×Ö·û´®
--²âÊÔÊý¾Ý
if object_id('[tb]') is not null drop table [tb]
create table [tb]([a] varchar(200))
go
insert [tb]
select 'aaaa  bbbb cccc        dddd'
insert [tb]
select 'eeeeee  ffff hhhh     ......

MSSQL´æ´¢¹ý³ÌʵÀý

Create proc RegisterUser
(
@usrName varchar(30)
,@usrPasswd varchar(30)
,@age int
,@PhoneNum varchar(20)
,@Address varchar(50)
)
as
begin
--ÏÔʾ¶¨Òå²¢¿ªÊ¼Ò»¸öÊÂÎñ
begin tran
insert into user
(
userName
,userPasswd
)
values
(
@usrName
,@usrPassw ......

MsSQL,MySQL,Oracle,Êý¾Ý¿âÁ¬½Ó×Ö¶Î

Ms sql 2000
drivername=com.microsoft.jdbc.sqlserver.SQLServerDriver
url=jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=books
username=sa
password=sa
MySQL
drivername=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost/books
username=root
password=root
Oracle
drivername=orac ......

½²½âMSSQLÊý¾Ý¿âÖÐSQLËø»úÖƺÍÊÂÎñ¸ôÀ뼶±ð

Ëø»úÖÆ
NOLOCKºÍREADPASTµÄÇø±ð¡£
1. ¿ªÆôÒ»¸öÊÂÎñÖ´ÐвåÈëÊý¾ÝµÄ²Ù×÷¡£
BEGIN TRAN t
INSERT INTO Customer
SELECT 'a','a'
2. Ö´ÐÐÒ»Ìõ²éѯÓï¾ä¡£
SELECT * from Customer WITH (NOLOCK)
½á¹ûÖÐÏÔʾ"a"ºÍ"a"¡£µ±1ÖÐÊÂÎñ»Ø¹öºó£¬ÄÇôa½«³ÉΪÔàÊý¾Ý¡£(×¢:1ÖеÄÊÂÎñδÌá½») ¡£NOLOCK±íÃ÷ûÓжÔÊý¾Ý±íÌí¼Ó¹²Ï ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ