-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Arian_Intellect
Message 5 in Discussion


ok sure man
 
 
pass the string as first paramter and delimiter in 
the second
 

CREATE    FUNCTION FN_SPLIT ( 

 @src_str  AS  VARCHAR(5000),
 @row_delim  AS  VARCHAR(100)
 )
RETURNS 
@TEMP1 TABLE
   (
 COL_1 VARCHAR(2000)
   
)
BEGIN
 DECLARE @temp_str  AS VARCHAR(5000)
 DECLARE @start_pos  AS INT --Start 
position
 DECLARE @end_pos  AS INT --End 
position
 DECLARE @row_delim_len  AS INT
 DECLARE @col_delim_len  AS INT
 DECLARE @len   AS INT
 
 
 SELECT @end_pos  = CHARINDEX(@row_delim, 
@src_str)
 SELECT @start_pos = 1
 SELECT @row_delim_len = 
LEN(@row_delim)
 
 WHILE @end_pos > 0
 BEGIN
  SELECT @len = 
@end_pos - @start_pos
  IF @len > 0 

   SELECT @temp_str = SUBSTRING ( @src_str , @start_pos 
,@len  ) 
  SELECT @start_pos = @end_pos + 
@row_delim_len
  SELECT @end_pos  = CHARINDEX(@row_delim, 
@src_str,@start_pos)
  INSERT INTO @TEMP1 SELECT 
ISNULL(@temp_str,'')
 END
  SELECT @len = LEN(@src_str) - 
@start_pos + @row_delim_len
  IF @len > 0 

  BEGIN
   SELECT @temp_str = SUBSTRING ( 
@src_str , @start_pos ,@len  ) 
   INSERT INTO @TEMP1 
SELECT ISNULL(@temp_str,'')
  END
 RETURN
END
 
 
 

 
 
Shaju Thomas
e-Cosmos Technologies Ltd.,
Mail: [EMAIL PROTECTED]
Phone(Off) 
:  51217038/39 Extn: 132
Mobile:  +91 98455 21794

  ----- Original Message ----- 
  From: 
  DIGITAL 
  PIRATE 
  To: BDOTNET 
  Sent: Tuesday, October 28, 2003 11:45 
  AM
  Subject: Re: SQL - Transferring data from 
  one table to another !!!
  
-----------------------------------------------------------

New 
  Message on 
  BDOTNET

-----------------------------------------------------------
From: 
  DIGITAL PIRATE
Message 3 in Discussion

Hi Shaju,   Why 
  not? Send the function ... I am not a SQL geek and could learn something from 
  it ...    Thanks, 
  Shamir

-----------------------------------------------------------

To 
  stop getting this e-mail, or change how often it arrives, go to your E-mail 
  Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need 
  help? If you've forgotten your password, please go to Passport Member 
  Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For 
  other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If 
  you do not want to receive future e-mail from this MSN group, or if you 
  received this message by mistake, please click the "Remove" link below. On the 
  pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
  address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]


-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to