problems with sqlps-commands

Welcome Forums General PowerShell Q&A problems with sqlps-commands

This topic contains 1 reply, has 2 voices, and was last updated by

4 years, 3 months ago.

  • Author
  • #20143

    Points: 0
    Rank: Member

    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');"

    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?

  • #20181

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    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.

The topic ‘problems with sqlps-commands’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort