I have some stored procedures that I would like to improve the maintenance efforts on. These stored procedures execute SQL statements from different databases on different servers. I would like to be able to make the stored procedures more generic so I don't have to change the server and database name in several places when changing between development and production environments. Below is a snippet of some of the code. The DEVSQL1 is the server name and TESTDB is the database.
insert into devsql1.testdb.dbo.audit_trail
(uptime, process_name, table_name, iud_ind, productiondate)
values (getdate(), 'int_transfer_DEV', 'production', 'x', @trans_date)
insert into devsql1.testdb.dbo.production
(date, ...
Is there anyway to define a parameter or value at the top of the stored procedures so the maintenance effort can be dramatically reduced?
Thanks,
MH
insert into devsql1.testdb.dbo.audit_trail
(uptime, process_name, table_name, iud_ind, productiondate)
values (getdate(), 'int_transfer_DEV', 'production', 'x', @trans_date)
insert into devsql1.testdb.dbo.production
(date, ...
Is there anyway to define a parameter or value at the top of the stored procedures so the maintenance effort can be dramatically reduced?
Thanks,
MH