Monday, March 19, 2012
Asian characters converted to ? in ntext field
I had an error in one of my applications where the following sqlstatement
was executed:
INSERT INTO tblRESPONSE(ANSWER) VALUES('AsianCharactersHere')
The correct statment would have included the leadning "N" as follows:
INSERT INTO tblRESPONSE(ANSWER) VALUES(N'AsianCharactersHere')
This error resulted in question marks being inserted into the database
instead of the asian characters.
Is there *any* way to retrieve the asian characters? It appears that each
of the characters was truncated which is where the question marks come from.
I tried to use lumigent log explorer to recreate the erroneous rows from the
logs, but without success. Is the original insert command stored somewhere?
Any help would be greatly appreciated.
I just talked to microsoft sqlserver tech support. If you use the default
character set, there is no way to retrieve the data. The text is converted
to the question mark characters before it is recorded anywhere in the sql
engine.
"PJBerry" wrote:
> I have an ntext field labeled answer in one of my tables.
> I had an error in one of my applications where the following sqlstatement
> was executed:
> INSERT INTO tblRESPONSE(ANSWER) VALUES('AsianCharactersHere')
> The correct statment would have included the leadning "N" as follows:
> INSERT INTO tblRESPONSE(ANSWER) VALUES(N'AsianCharactersHere')
> This error resulted in question marks being inserted into the database
> instead of the asian characters.
> Is there *any* way to retrieve the asian characters? It appears that each
> of the characters was truncated which is where the question marks come from.
> I tried to use lumigent log explorer to recreate the erroneous rows from the
> logs, but without success. Is the original insert command stored somewhere?
> Any help would be greatly appreciated.
>
Asian characters converted to ? in ntext field
I had an error in one of my applications where the following sqlstatement
was executed:
INSERT INTO tblRESPONSE(ANSWER) VALUES('AsianCharactersHere')
The correct statment would have included the leadning "N" as follows:
INSERT INTO tblRESPONSE(ANSWER) VALUES(N'AsianCharactersHere')
This error resulted in question marks being inserted into the database
instead of the asian characters.
Is there *any* way to retrieve the asian characters? It appears that each
of the characters was truncated which is where the question marks come from.
I tried to use lumigent log explorer to recreate the erroneous rows from the
logs, but without success. Is the original insert command stored somewhere?
Any help would be greatly appreciated.I just talked to microsoft sqlserver tech support. If you use the default
character set, there is no way to retrieve the data. The text is converted
to the question mark characters before it is recorded anywhere in the sql
engine.
"PJBerry" wrote:
> I have an ntext field labeled answer in one of my tables.
> I had an error in one of my applications where the following sqlstatement
> was executed:
> INSERT INTO tblRESPONSE(ANSWER) VALUES('AsianCharactersHere')
> The correct statment would have included the leadning "N" as follows:
> INSERT INTO tblRESPONSE(ANSWER) VALUES(N'AsianCharactersHere')
> This error resulted in question marks being inserted into the database
> instead of the asian characters.
> Is there *any* way to retrieve the asian characters? It appears that each
> of the characters was truncated which is where the question marks come from.
> I tried to use lumigent log explorer to recreate the erroneous rows from the
> logs, but without success. Is the original insert command stored somewhere?
> Any help would be greatly appreciated.
>
Asian characters converted to ? in ntext field
I had an error in one of my applications where the following sqlstatement
was executed:
INSERT INTO tblRESPONSE(ANSWER) VALUES('AsianCharactersHere')
The correct statment would have included the leadning "N" as follows:
INSERT INTO tblRESPONSE(ANSWER) VALUES(N'AsianCharactersHere')
This error resulted in question marks being inserted into the database
instead of the asian characters.
Is there *any* way to retrieve the asian characters? It appears that each
of the characters was truncated which is where the question marks come from.
I tried to use lumigent log explorer to recreate the erroneous rows from the
logs, but without success. Is the original insert command stored somewhere?
Any help would be greatly appreciated.I just talked to microsoft sqlserver tech support. If you use the default
character set, there is no way to retrieve the data. The text is converted
to the question mark characters before it is recorded anywhere in the sql
engine.
"PJBerry" wrote:
> I have an ntext field labeled answer in one of my tables.
> I had an error in one of my applications where the following sqlstatement
> was executed:
> INSERT INTO tblRESPONSE(ANSWER) VALUES('AsianCharactersHere')
> The correct statment would have included the leadning "N" as follows:
> INSERT INTO tblRESPONSE(ANSWER) VALUES(N'AsianCharactersHere')
> This error resulted in question marks being inserted into the database
> instead of the asian characters.
> Is there *any* way to retrieve the asian characters? It appears that each
> of the characters was truncated which is where the question marks come fro
m.
> I tried to use lumigent log explorer to recreate the erroneous rows from t
he
> logs, but without success. Is the original insert command stored somewher
e?
> Any help would be greatly appreciated.
>
Ascii Code search
I'm tring to create a sql query in 6.5 that will find any unprintable
characters in a text field. I'm trying to use a where clause that looks
for specific ASCII codes but cant seem to get it work. Does anyone have
any ideas how to do this.
Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!David,
You can use below technique. In my example, I used CHAR(99) which is the letter 'c'. Replace this with the
ASCII code for the unprintable character you want to find.
SELECT *
FROM
(
SELECT 'abcdef' AS colname
UNION
SELECT 'abdef' AS colname
) AS d
WHERE CHARINDEX(CHAR(99), colname) > 0
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Cervelli" <cervelli@.adelphia.net> wrote in message news:OkpMIugiEHA.1348@.tk2msftngp13.phx.gbl...
> Hi;
> I'm tring to create a sql query in 6.5 that will find any unprintable
> characters in a text field. I'm trying to use a where clause that looks
> for specific ASCII codes but cant seem to get it work. Does anyone have
> any ideas how to do this.
> Thanks
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
Thursday, February 9, 2012
Are text pages deleted when a column is converted to varchar
design view of a table within Enterprise Manager the
varchar value (less than 8000 characters) appears in the
column but does SQL Server automatically delete the text
values from their pages?
If not are they removed by routine reindex/defrag or
should I create a new table, import from the text as
varchar and drop the old table to make sure the pages
storing the original text version of the values are
deleted?
..morriszone@.hotmail.com (Steve Morris) wrote in message news:<757b6d8f.0404080820.7956cf62@.posting.google.com>...
> When I change a column from text to varchar using the
> design view of a table within Enterprise Manager the
> varchar value (less than 8000 characters) appears in the
> column but does SQL Server automatically delete the text
> values from their pages?
> If not are they removed by routine reindex/defrag or
> should I create a new table, import from the text as
> varchar and drop the old table to make sure the pages
> storing the original text version of the values are
> deleted?
> .
just try:
select * into your_table_bak from your_table
and then try your alter table statment with no risk of dataloss!
alter table *your_table_bak* :-)
if you dont like to read 8000 charakter to find out wether some data
is loss or not try the function
"getsize"
hth