Friday, March 30, 2012

Is there a single string or other function in SQL Server that retu

Hello:
Is there a single, undocumented function in SQL Server 2000 or 2005 that
returns the first letter of each word in a sentence or group of words as
upper case and the remaining letters in lower case? We can do this with
custom programming using a combination of string functions but for our
purposes using string functions in combination is too slow with the huge dat
a
sets we deal with.
For Example:
We may receive a name in the following format: mr. john r. doe jr. within a
CSV file. Has Microsoft developed a new string function that will produce
Mr. John R. Doe Jr. by simply feeding the string "mr. john r. doe jr.” to
the
function?No, there is not an undocumented function that does this (or a documented
one for that matter).
Perhaps you should build your function using SQLCLR rather than T-SQL.
SQLCLR tends to outperform T-SQL quite a bit when it comes to string
manipulation.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Chandler Miller" <Chandler Miller@.discussions.microsoft.com> wrote in
message news:72DD96C2-0AFB-4AD2-AF7A-A3B5F6023C2E@.microsoft.com...
> Hello:
> Is there a single, undocumented function in SQL Server 2000 or 2005 that
> returns the first letter of each word in a sentence or group of words as
> upper case and the remaining letters in lower case? We can do this with
> custom programming using a combination of string functions but for our
> purposes using string functions in combination is too slow with the huge
> data
> sets we deal with.
> For Example:
> We may receive a name in the following format: mr. john r. doe jr. within
> a
> CSV file. Has Microsoft developed a new string function that will produce
> Mr. John R. Doe Jr. by simply feeding the string "mr. john r. doe jr." to
> the
> function?
>
>|||A function if there is one, which I highly doubt, would run through the same
steps you probalby are doing already. Can you split the data first, then
upper(data), then combine again ?
or better yet use dts package to import with query (steps of upper, trim,
etc.).
dts packs fly on large datasets.
"Chandler Miller" wrote:

> Hello:
> Is there a single, undocumented function in SQL Server 2000 or 2005 that
> returns the first letter of each word in a sentence or group of words as
> upper case and the remaining letters in lower case? We can do this with
> custom programming using a combination of string functions but for our
> purposes using string functions in combination is too slow with the huge d
ata
> sets we deal with.
> For Example:
> We may receive a name in the following format: mr. john r. doe jr. within
a
> CSV file. Has Microsoft developed a new string function that will produce
> Mr. John R. Doe Jr. by simply feeding the string "mr. john r. doe jr.” t
o the
> function?
>
>|||You could try the function here, though it wasn't produced by Microsoft:
http://www.aspfaq.com/2299
"Chandler Miller" <Chandler Miller@.discussions.microsoft.com> wrote in
message news:72DD96C2-0AFB-4AD2-AF7A-A3B5F6023C2E@.microsoft.com...
> Hello:
> Is there a single, undocumented function in SQL Server 2000 or 2005 that
> returns the first letter of each word in a sentence or group of words as
> upper case and the remaining letters in lower case? We can do this with
> custom programming using a combination of string functions but for our
> purposes using string functions in combination is too slow with the huge
> data
> sets we deal with.
> For Example:
> We may receive a name in the following format: mr. john r. doe jr. within
> a
> CSV file. Has Microsoft developed a new string function that will produce
> Mr. John R. Doe Jr. by simply feeding the string "mr. john r. doe jr.”
> to the
> function?
>
>

No comments:

Post a Comment