user2110655
user2110655

Reputation:

sql delete not working with à

I am trying to delete a row in a database, but for some reason it is not working.

SELECT * FROM <tablename> 
WHERE MAPPING_ID = '66' 
  AND FIELD_VALUE = 'Sanità' 
  AND PARENT_VALUE = 'ITA';

Result: 66 Sanità ITA

DELETE FROM <tablename> 
WHERE MAPPING_ID = '66' 
  AND FIELD_VALUE = 'Sanità' 
  AND PARENT_VALUE = 'ITA';

Result: 0 rows deleted.

I am guessing it is due to the à. I already have SET DEFINE OFF , but still no go.

Any suggestions?

Upvotes: 4

Views: 243

Answers (3)

Sudhir Panda
Sudhir Panda

Reputation: 784

DELETE FROM <tablename> 
WHERE MAPPING_ID = '66' 
  AND FIELD_VALUE = N'Sanità' 
  AND PARENT_VALUE = 'ITA';

try this N use for match nvarchar value(Unicode)

hope this will help you.

Upvotes: 8

Jibin Balachandran
Jibin Balachandran

Reputation: 3441

You can try this:

DELETE FROM [dbo.youtablename]
WHERE MAPPING_ID = '66' 
AND FIELD_VALUE = 'Sanità'
AND PARENT_VALUE = 'ITA';

Or else set the MAPPING_ID as the primary key of the table and use:

DELETE FROM [dbo.youtablename]
WHERE MAPPING_ID = '66' 

Upvotes: 0

randytan
randytan

Reputation: 1039

The query you try to access is wrong the syntax should be:

DELETE FROM table
WHERE conditions;

If you want to specify the database name, use this

DELETE FROM schema.table
WHERE conditions;

Upvotes: 0

Related Questions