0

While running through 3rd party NuGet Package called DbUp

INSERT INTO `portalquery` 
VALUES 
(31,'update portal.Config_PropertyValues set value = \''<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n<data></fata>\'' where engineid = \''@engineid\'' and PropertyID = \''459\'';'',''Set Demograhpics node refresh interval to \''1\''',NULL,NULL,6)

I am getting following error:

Script block number: 12; Error code -2147467259; Message: Fatal error encountered during command execution.
MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered during command execution. ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Parameter '?xml' must be defined.

I know what the issue is here but I am not able to escape "?" mark no matter what I do.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Adeel
  • 43
  • 7
  • query looking little confusing, just to clarify its an update query inside insert query that stores in column for later use – Adeel Oct 10 '17 at 19:08
  • Get it working with SQL Server Management Studio (SSMS) which comes with SQL Server. the error message are much better in SSMS than VS. – jdweng Oct 10 '17 at 19:42
  • It would help if you can post what exactly are you trying to insert, without added escape characters. – OctoCode Oct 10 '17 at 19:55
  • @OctoCode this is what I want to insert in column 'update portal.Config_PropertyValues set value = \''\r\n\'' where engineid = \''@engineid\'' and PropertyID = \''459\'';' – Adeel Oct 15 '17 at 09:35
  • Your problem, as you can see from the syntax highlighting in the code you've posted, is that you're escaping the quote wrong: `\'` is an escaped quote then the next `'` closes the string, meaning ` – Rup Jun 05 '20 at 11:08
  • (I realise this is a very old question, but someone's just brought it back to the front page by posting a spam answer.) – Rup Jun 05 '20 at 11:08

0 Answers0