I have someone who altered all of the data in our database [22 million lines
]
that added in a line feed and carriage return in one of the fields. It needs
to
be removed. How do I remove hex values OD OA from a database field?Try something similar to:
declare @.crlf varchar(2)
set @.crlf = char(13) + char(10)
update mytable
set myfield = replace(myfield, @.crlf, '')
TEST ON A DEVELOPMENT DATABASE FIRST !!!!!!
Mike
"jeff fisher" <jeff@.fisher.com> wrote in message
news:OvUhzMCTFHA.2096@.TK2MSFTNGP14.phx.gbl...
> I have someone who altered all of the data in our database [22 million
lines]
> that added in a line feed and carriage return in one of the fields. It
needs to
> be removed. How do I remove hex values OD OA from a database field?
Showing posts with label fields. Show all posts
Showing posts with label fields. Show all posts
Friday, March 30, 2012
Remove Fields Programatically
Is it possible to remove fields programatically from a report file at run time?
I have too many years worth or data being returned and it exceeds the width of an A4 page - So I want to allow the users to select the years that they wish to view via a checkedlistbox - but each time I remove the Columns from the dataTable that populates the report files I get an error as noted below
I'm using VS 2005 and CR shipped with it...
<error>
The field name is not known.
Error in Filed C:\documents and settings\<insert file path here>\rpt_siz_xty {EBEF8981-654C-42C7-9DDA-3AC4184771C8}.RPT:
Error in formula <sizYr01>.
If IsNull({sp_rpt_siz_xty;1.sizYr01}) Then space(12) Else Cstr({sp_rpt_siz_xty;1.sizYr01})
The field name is not known.
</error>
I've dome a fair amount of searching and can't seem to find any remove methods for the field definitions...
Anyone?I think the field u r deleting is used in a formula in report. U need to delete that formula also.|||Why do you want to do it at runtime?
I have too many years worth or data being returned and it exceeds the width of an A4 page - So I want to allow the users to select the years that they wish to view via a checkedlistbox - but each time I remove the Columns from the dataTable that populates the report files I get an error as noted below
I'm using VS 2005 and CR shipped with it...
<error>
The field name is not known.
Error in Filed C:\documents and settings\<insert file path here>\rpt_siz_xty {EBEF8981-654C-42C7-9DDA-3AC4184771C8}.RPT:
Error in formula <sizYr01>.
If IsNull({sp_rpt_siz_xty;1.sizYr01}) Then space(12) Else Cstr({sp_rpt_siz_xty;1.sizYr01})
The field name is not known.
</error>
I've dome a fair amount of searching and can't seem to find any remove methods for the field definitions...
Anyone?I think the field u r deleting is used in a formula in report. U need to delete that formula also.|||Why do you want to do it at runtime?
Monday, March 26, 2012
Removal of punctuation from fields
Hey,
I require ALL the punctuation in a field to be removed. By all punctuation,
i mean \ / ' - ( ) * &^ % $ £ " ! etc etc.
i know i could always do a 'REPLACE' on these and just replace them with
blank spaces, but just wondering if theres any function that would allow me
to remove all the punctuation, as i dont really want to do a replace on ever
y
bit of punctuation.
Cheers
Rob.Hi
SELECT * INTO #temp
FROM
(
SELECT ' ', SPACE(1) UNION
SELECT '?', SPACE(0) UNION
SELECT '!', SPACE(0) UNION
SELECT '#', SPACE(0) UNION
SELECT '*', SPACE(0)
......
......
) AS a (Dirty, Good)
DECLARE @.String VARCHAR(50)
SELECT @.String = 'We? are* the #world!'
UPDATE #temp
SET @.String = REPLACE(@.String, Dirty, Good )
WHERE CHARINDEX(Dirty , @.String) > 0
PRINT @.String
"MACNR" <MACNR@.discussions.microsoft.com> wrote in message
news:B60345AB-9347-40A3-895F-CB4FA37EC0D3@.microsoft.com...
> Hey,
> I require ALL the punctuation in a field to be removed. By all
> punctuation,
> i mean \ / ' - ( ) * &^ % $ " ! etc etc.
> i know i could always do a 'REPLACE' on these and just replace them with
> blank spaces, but just wondering if theres any function that would allow
> me
> to remove all the punctuation, as i dont really want to do a replace on
> every
> bit of punctuation.
> Cheers
> Rob.sql
I require ALL the punctuation in a field to be removed. By all punctuation,
i mean \ / ' - ( ) * &^ % $ £ " ! etc etc.
i know i could always do a 'REPLACE' on these and just replace them with
blank spaces, but just wondering if theres any function that would allow me
to remove all the punctuation, as i dont really want to do a replace on ever
y
bit of punctuation.
Cheers
Rob.Hi
SELECT * INTO #temp
FROM
(
SELECT ' ', SPACE(1) UNION
SELECT '?', SPACE(0) UNION
SELECT '!', SPACE(0) UNION
SELECT '#', SPACE(0) UNION
SELECT '*', SPACE(0)
......
......
) AS a (Dirty, Good)
DECLARE @.String VARCHAR(50)
SELECT @.String = 'We? are* the #world!'
UPDATE #temp
SET @.String = REPLACE(@.String, Dirty, Good )
WHERE CHARINDEX(Dirty , @.String) > 0
PRINT @.String
"MACNR" <MACNR@.discussions.microsoft.com> wrote in message
news:B60345AB-9347-40A3-895F-CB4FA37EC0D3@.microsoft.com...
> Hey,
> I require ALL the punctuation in a field to be removed. By all
> punctuation,
> i mean \ / ' - ( ) * &^ % $ " ! etc etc.
> i know i could always do a 'REPLACE' on these and just replace them with
> blank spaces, but just wondering if theres any function that would allow
> me
> to remove all the punctuation, as i dont really want to do a replace on
> every
> bit of punctuation.
> Cheers
> Rob.sql
Subscribe to:
Posts (Atom)