Issues Creating SQL Server triggers using SQuirreL SQL Client

后端 未结 3 896
無奈伤痛
無奈伤痛 2021-01-28 16:09

Recently I have been working with a SQL Server database and I was trying to create some triggers for some tables using SQuirreL SQL Client and for some reason I was unable to ge

相关标签:
3条回答
  • 2021-01-28 16:19

    I was having the same problem. After some Googling, I found this article:

    http://vsingleton.blogspot.com/2009/04/error-create-view-must-be-first.html

    In short, wrap exec('') around your create trigger statement. In addition, any single quotes (') you have in the trigger statement need to be changed double single quotes ('').

    0 讨论(0)
  • 2021-01-28 16:29

    I couldn't replicate this on SQuirrel SQL v2.6.8 using v1.2.2 of the jTDS jbdc driver against SQL 2005 SP3 (developer edition).

    0 讨论(0)
  • 2021-01-28 16:32

    Usually you get that error when attempting to run multiple statements in the same batch that are not allowed to be anything but the first statement in a batch. You may need a GO in between them. GO is not a SQL command but really a directive to the client tool to separate batches of commands.

    0 讨论(0)
提交回复
热议问题