Showing posts with label helloi. Show all posts
Showing posts with label helloi. Show all posts

Wednesday, March 21, 2012

Grabbing characters from a string

Hello

I want to write a stored procedure (using Enterprise Manager) that can grab
the digits that are inbetween the two dashes (-) in strings like:
123-150-40
1-123-8
32-4215-61

The digits to the left, right and inbetween the dashes could be any length,
so a static "get the 5th, 6th and 7th digit" stored procedure won't work.

Many thanks,

--
Chris Michael
www.INTOmobiles.com
Download 100s of ringtones, wallpapers & logos every month for only 1.50
per weekChris Michael (news@.intomobiles.com) writes:
> I want to write a stored procedure (using Enterprise Manager) that can
> grab the digits that are inbetween the two dashes (-) in strings like:
> 123-150-40
> 1-123-8
> 32-4215-61
> The digits to the left, right and inbetween the dashes could be any
> length, so a static "get the 5th, 6th and 7th digit" stored procedure
> won't work.

And you want the result to be? Do you want:

12315040
11238
32421561

That is, one single number formed? That would be easy with help of
the replace() function.

Or do you want triplets like:

123, 150, 40
1, 123, 8
32, 4215, 61

And in such case, is there always exactly two dashes, or can you have

123-3455-2345-23345-2349-2-23

If you always have two dashes, using a combination of substring(),
patindex(), reverse(), right() and left() might do the trick.

All functions I have mentioned here, are listed in Books Online under
Functions, String Functions.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

GPRS replication troubles : 28562

Hello:
I get this number of errors when I'm trying to merge replicate over GPRS. It
occurs only some times:
error 80072EE7 with native 28562
error 80072EFD with native 28562
and after those errors I get 80004005 with 28557.
What about are these errors? why the database gets unstable? how can I avoid
that?
Thanks a lot
Where and how do see this errors? Can you give more context?
This posting is provided "AS IS" with no warranties, and confers no rights.
OR if you wish to include a script sample in your post please add "Use of
included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm"
"Juan" <juan@.mailinator.com> wrote in message
news:%23aF6Shg1EHA.2112@.TK2MSFTNGP15.phx.gbl...
> Hello:
> I get this number of errors when I'm trying to merge replicate over GPRS.
It
> occurs only some times:
> error 80072EE7 with native 28562
> error 80072EFD with native 28562
> and after those errors I get 80004005 with 28557.
> What about are these errors? why the database gets unstable? how can I
avoid
> that?
> Thanks a lot
>
|||I get those errors from time to time when I try to repliate over GPRS.
Normally it works fine. They happen at the begining of the synchronization.
At server side there's no message about them, the merge agent doesn't start.
I use SL Server CE 2.0 with SQL Server 2000 and SP3. The synchronization
works fine, and the URL od the agent os correct.
Thanks Viajy
"Vijay [MSFT]" <vijayts@.online.microsoft.com> escribi en el mensaje
news:e260Zfn1EHA.3596@.TK2MSFTNGP12.phx.gbl...
> Where and how do see this errors? Can you give more context?
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> OR if you wish to include a script sample in your post please add "Use of
> included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm"
> "Juan" <juan@.mailinator.com> wrote in message
> news:%23aF6Shg1EHA.2112@.TK2MSFTNGP15.phx.gbl...
> It
> avoid
>