We need to be able to script objects (tables, user functions, stored procedures) with the below structure:
if exists(---) then drop procedure xxx
create procedure xxx
This is available in SQL Server 2000, but I have not been able to do it in SQL Server 2005.
It seems SQL Server 2005 has
alter procedure xxx,
or
create procedure xxx,
or
drop procedure xxx,
but no option to
if exists then drop procedure xxx
create procedure xxx
What's ironic is that the template for creating stored procedure in our SQL Server 2005 instance is set up with
if exists then drop xxx
create xxx
but will they script that way ?? Nope.
This puts a big crimp in our established procedures for generating new service packs for our customers. It seems a really stupid thing for MS to do. Or am I the dummy (LOL), am I just missing something ?
Thanks
if exists(---) then drop procedure xxx
create procedure xxx
This is available in SQL Server 2000, but I have not been able to do it in SQL Server 2005.
It seems SQL Server 2005 has
alter procedure xxx,
or
create procedure xxx,
or
drop procedure xxx,
but no option to
if exists then drop procedure xxx
create procedure xxx
What's ironic is that the template for creating stored procedure in our SQL Server 2005 instance is set up with
if exists then drop xxx
create xxx
but will they script that way ?? Nope.
This puts a big crimp in our established procedures for generating new service packs for our customers. It seems a really stupid thing for MS to do. Or am I the dummy (LOL), am I just missing something ?
Thanks