i use the statement drop trigger if exist TRIGGER in sqlite but sql server doesnt like the if statement. (i guess exist is the offending word). I do this right next to my create trigger statement because i want to drop older triggers with the same name so i can replace it with this new one. How do i do this in SQL server?
drop trigger if exist TRIGGER
You can check for the existence of a specific Trigger like so.
IF EXISTS ( select name from sys.objects where type='TR' and name ='Trigger Name' ) BEGIN --Add your Trigger create code here END