# problems with sqlps-commands

**URL:** <https://forums.powershell.org/t/problems-with-sqlps-commands/3335>\
**Category:** PowerShell Help\
**Created:** [October 29, 2014, 9:56pm UTC](https://forums.powershell.org/t/problems-with-sqlps-commands/3335 "2014-10-29T21:56:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![axel-schmidt](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@axel-schmidt](https://forums.powershell.org/u/axel-schmidt)\
**Post date:** [October 29, 2014, 9:56pm UTC](https://forums.powershell.org/t/problems-with-sqlps-commands/3335/1 "2014-10-29T21:56:19Z")

</div>

Hi,  
I have a Problem running some SQL-commands with powershell:

$Command.CommandText = “Insert into [smartPN\_Config].[dbo].[Text] (textid,languageid, textclass,  
text, longtext,informadministrator) values  
(‘ERROR\_1000’,‘DE’,‘error’,‘Fehler beim Empfang einer Nachricht von Unit "{smartUnitId}" (RemoteEndpoint:{RemoteEndpoint})’,  
'Beim Empfang einer Nachricht von der smartUnit "{smartUnitId}" (RemoteEndpoint="{RemoteEndpoint})" wurde eine unerwartete Exception Type="{ExceptionType}" mit der Nachricht "{ExceptionMessage}"empfangen. ',‘1’);”  
$Command.ExecuteNonQuery()

He complains as Parser error for the { and } in the data of the SQL-command.  
Taking of the brackets - no Problems.  
The SQL-commands in the Management Studio work fine.  
Any ideas?  
Thanks!

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [October 30, 2014, 9:22am UTC](https://forums.powershell.org/t/problems-with-sqlps-commands/3335/2 "2014-10-30T09:22:08Z")

</div>

So, to be clear, these aren’t SQL commands, they’re the .NET SqlClient classes. Bit different.

It would help if you could post the specific error message, especially if you can do so from an English language version of PowerShell. But, at a guess, curly brackets are reserved characters for PowerShell and it’s probably trying to interpret what’s inside them as code.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:46pm UTC](https://forums.powershell.org/t/problems-with-sqlps-commands/3335/3 "2024-05-16T20:46:48Z")

</div>


