Skip to content

Tag: sql-server-2008

drop trigger if exists and create

I would like to check if the trigger exists on [tbl] and create another one. I tried it this way but didn’t work. What am I doing wrong? Answer The [name] field in sys.objects will contain only the actual name (i.e. trg), not including the schema (i.e. dbo in this case) or any text qualifiers (i.e. [ an…

convert datetime (mm/dd/YYYY) to decimal(YYYYmmDD)

I am trying to get the following result in Sql: example: 23/05/2014 to 20142305 but get this: result:41780 anyone know how you can get the following format?? (if possible ??) regards and thanks Answer In many databases (including SQL Server), you can just do: Some databases don’t support these functions…