Showing posts with label enter. Show all posts
Showing posts with label enter. Show all posts

Tuesday, February 14, 2012

Breaking out data from a text field type

In my database there is a text field type that is used to enter street
address. This address could be a few lines long, each line with a
carriage return at the end.
Is there a way to search for these carriage returns and break out what
is in each line seperately?

Thanks.
Mike[posted and mailed, please reply in news]

Mike (mrea@.ohiotravelbag.com) writes:
> In my database there is a text field type that is used to enter street
> address. This address could be a few lines long, each line with a
> carriage return at the end.
> Is there a way to search for these carriage returns and break out what
> is in each line seperately?

Is that really the datatype text? That seems a bit over kill for a street
address. They would very rarely be over 8000 bytes. Or even 4000 if you
are using varchar.

The functions to use are substring and charindex. And char(13) for the
CRs. Or char(13) + char(10) if it's actually CR + LF. charindex does not
handle text beyond the varchar limit, but I don't think this would be
an issue.

You could also do:

SELECT @.adr = adr FROM tbl WHERE ..
SELECT str
FROM iter_charlist_to_table(@.adr, char(13))
ORDER BY listpos

You find this function on
http://www.sommarskog.se/arrays-in-...list-of-strings

Note that if you need to use char(13) + char(10) as delimiter, you
will have to change the function. (And not only the length of delimiter.)

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

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

Sunday, February 12, 2012

bpasetup install interruption?

Hi- My basic bpasetup install is not completing on Win2000 Advanced Server SP4/SQL Server 2000.
I get to the point where I enter my servername and authentication mode. I have tried my server name and my servername\instance name in both security modes. Nothing seems to compete the installation (the message says it is interrupted and to restart the
install).
How can I get it to complete? I have disabled McAffee as well but left up all SQL services.
Thanks!
Susan
Can you please generate an installation log and post it here or send it to
me?
To generate the verbose log run:
msiexec.exe /i BPASETUP.msi /L*v .\bpainstall.log
- Christian
___________________________
Christian Kleinerman
Program Manager, SQL Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Susan" <Susan@.discussions.microsoft.com> wrote in message
news:8C94F4F9-05A7-48E6-8296-FEC352D17EF3@.microsoft.com...
> Hi- My basic bpasetup install is not completing on Win2000 Advanced Server
SP4/SQL Server 2000.
> I get to the point where I enter my servername and authentication mode. I
have tried my server name and my servername\instance name in both security
modes. Nothing seems to compete the installation (the message says it is
interrupted and to restart the install).
> How can I get it to complete? I have disabled McAffee as well but left up
all SQL services.
> Thanks!
|||Christian- I emailed you the log but the post here has a limit of 30000 text (the log isdouble). Please email me if you haven't received or a preferred area where I can post/ftp the log to you. Thanks- Susan
Thanks!