Quick Search


Tibetan singing bowl music,sound healing, remove negative energy.

528hz solfreggio music -  Attract Wealth and Abundance, Manifest Money and Increase Luck



 
Your forum announcement here!

  Free Advertising Forums | Free Advertising Board | Post Free Ads Forum | Free Advertising Forums Directory | Best Free Advertising Methods | Advertising Forums > Post Your Free Ads Here in English for Advertising .Adult and gambling websites NOT accepted. > Other

Other Post anything that does not fit in the above categories here.

Reply
 
Thread Tools Display Modes
Old 05-26-2011, 11:20 AM   #1
8374p1vqyy
 
Posts: n/a
Default SQL string in the section feature alike apt SP

SQL string processing power is relatively weak, such as 1,2,3,4,5 I absence apt circulate through this string, if the order,GHD IV Styling Set, then traverse a quite uncomplicated, merely T-SQL does no patronize order So many difficulty treatment down. The emulating functions apt attain the same dispose as the array of strings. First, as a transient chart with a crowd of establish function f_split (@ c varchar (2000), @ split varchar (2)) returns ; @ t table (column varchar (20)) as start ; while (charindex (@ split, @ c) 0) begin ; insert @ t (col) amounts ​​(substring (@ c, 1, charindex (@ split, @ c) -1 )) set @ c = stuff (@ c, 1, charindex (@ split, @ c ),'') bring an end to ...sert @ t (col) merits ​​(@ c) return end go select * from dbo.f_split ('dfkd, dfdkdf, dfdkf, dffjk',GHD Pink Limited Edition,',GHD Midnight Gift Set 2011,') drop ; function f_split col ; ------- ------------- dfkd dfdkdf dfdkf dffjk ; (the digit of rows affected by 4 rows)
two symbols separated by the specified string and returns the number of elements after the split, the usage is very simple, there is to penetrate how numerous string delimiter, and then multiplication one, namely is, the required results. CREATE function Get_StrArrayLength (@ str varchar (1024), - the string to split @ split varchar (10) - separator) returns int as begin ; declare @ location int declare @ start int declare @ length int
set @ str = ltrim (rtrim (@ str)) set @ location = charindex (@ split, @ str) set @ length = 1 while @ location 0 begin ; set @ start = @ location +1 set @ location = charindex (@ split, @ str, @ start) set @ length = @ length +1 end return @ length end call example: select dbo.Get_StrArrayLength ('78, 1,2,3',GHD Hair Straightener,',') return value: 4
three characters separated along the specified string and returns the specified concordance partition after the 1st few elements of the array as cozy as CREATE function Get_StrArrayStrOfIndex (@ str varchar (1024), - to be split string @ split varchar (10), - separator @ index int - obtain the 1st of several elements) returns varchar (1024) as begin affirm @ location int declare @ start int declare @ next int declare @ seed int
set @ str = ltrim (rtrim (@ str)) set @ start = 1 set @ next = 1 set @ seed = len (@ split) set @ place = charindex (@ split, @ str) when @ situation 0 and @ index> @ next begin set @ start = @ location + @ seed set @ location = charindex (@ split, @ str, @ start) set @ next = @ next +1 end if @ location = 0 choose @ location = len (@ str) +1 - there are two situations here: 1, the string does not exist separator 2, there is a string delimiter,GHD Leopard Grain, while out of cycles, @ location is 0, then the default is after a string delimiter. return substring (@ str, @ start, @ location-@ start) end cry example: choose dbo.Get_StrArrayStrOfIndex ('8, 9,4',GHD IV Mini Straighteners,',', 2) return value: 9
3, combining two functions on, as the traverse the string as a cloud of elements
declare @ str varchar (50) set @ str = '1, 2,3,4,5 'declare @ next int set @ next = 1 while @ next <= dbo.Get_StrArrayLength (@ str ,',') begin print dbo.Get_StrArrayStrOfIndex (@ str ,',',next) set @ next = @ next +1 end
call results: 1 2 3 4 5
Posted in
  Reply With Quote

Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On


All times are GMT. The time now is 03:59 AM.

 

Powered by vBulletin Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Free Advertising Forums | Free Advertising Message Boards | Post Free Ads Forum