Showing posts with label updated. Show all posts
Showing posts with label updated. Show all posts

Monday, March 12, 2012

Make a copy of SQL DB and update/change stored procedures

Can I make a copy of my development database DEV on same SQL SERVER machine, rename it to TEST and stored procedures to be updated automatically for statements like

UPDATE [DEV].[dbo].[Company]

SET [company_name]= @.company_name

to become

UPDATE [TEST].[dbo].[Company]

SET [company_name]= @.company_name

in order not to edit each individual stored procedure for updating it ?

Hi Chris,

You would have to use SQL Query Analyzer.

USE test
GO

CREATE PROCREDURE p_company_update
@.company_id INT,
@.company_name VARCHAR(64)
AS
SET NOCOUNT ON
UPDATE company
SET company_name = @.company_name
WHERE company_id = @.company_id
GO

Good Coding!

Javier Luna
http://guydotnetxmlwebservices.blogspot.com/

|||Thanks for your message.

Wednesday, March 7, 2012

Maintenance Plans, SQL Agent daily restart needed

We have a SQL 2000 server running on Server 2003, both updated, that has a
persistent problem running Maintenance plans, and thus a database backup.
Trying to troubleshoot, I’ve updated, deleted and recreated the maint plans,
restarted the server altogether, SQL itself and the SQL Agent; the long and
short of it is that if I restart the SQL Agent daily, the maintenance plan
will run.
Previously, this server has been running the maintenance plans without fail
for literally years, and now this problem has cropped up over the last couple
of months. No significant changes have been made to the server (other apps,
etc).
Having to restart SQL agent daily doesn't make any sense - any ideas?
Gary
Waht version (sp and hotfix)?
Select @.@.version
Kevin3NF
SQL Server dude
You want fries with that?
http://kevin3nf.blogspot.com/
I only check the newsgroups during work hours, M-F.
Hit my blog and the contact links if necessary...I may be available.
"Gary" <Gary@.discussions.microsoft.com> wrote in message
news:8AB0A498-B268-4797-BD3E-8EDBD58B131A@.microsoft.com...
> We have a SQL 2000 server running on Server 2003, both updated, that has a
> persistent problem running Maintenance plans, and thus a database backup.
> Trying to troubleshoot, I've updated, deleted and recreated the maint
> plans,
> restarted the server altogether, SQL itself and the SQL Agent; the long
> and
> short of it is that if I restart the SQL Agent daily, the maintenance plan
> will run.
> Previously, this server has been running the maintenance plans without
> fail
> for literally years, and now this problem has cropped up over the last
> couple
> of months. No significant changes have been made to the server (other
> apps,
> etc).
> Having to restart SQL agent daily doesn't make any sense - any ideas?
> --
> Gary

Maintenance Plans, SQL Agent daily restart needed

We have a SQL 2000 server running on Server 2003, both updated, that has a
persistent problem running Maintenance plans, and thus a database backup.
Trying to troubleshoot, Iâ've updated, deleted and recreated the maint plans,
restarted the server altogether, SQL itself and the SQL Agent; the long and
short of it is that if I restart the SQL Agent daily, the maintenance plan
will run.
Previously, this server has been running the maintenance plans without fail
for literally years, and now this problem has cropped up over the last couple
of months. No significant changes have been made to the server (other apps,
etc).
Having to restart SQL agent daily doesn't make any sense - any ideas?
--
GaryWaht version (sp and hotfix)?
Select @.@.version
--
Kevin3NF
SQL Server dude
You want fries with that?
http://kevin3nf.blogspot.com/
I only check the newsgroups during work hours, M-F.
Hit my blog and the contact links if necessary...I may be available.
"Gary" <Gary@.discussions.microsoft.com> wrote in message
news:8AB0A498-B268-4797-BD3E-8EDBD58B131A@.microsoft.com...
> We have a SQL 2000 server running on Server 2003, both updated, that has a
> persistent problem running Maintenance plans, and thus a database backup.
> Trying to troubleshoot, I've updated, deleted and recreated the maint
> plans,
> restarted the server altogether, SQL itself and the SQL Agent; the long
> and
> short of it is that if I restart the SQL Agent daily, the maintenance plan
> will run.
> Previously, this server has been running the maintenance plans without
> fail
> for literally years, and now this problem has cropped up over the last
> couple
> of months. No significant changes have been made to the server (other
> apps,
> etc).
> Having to restart SQL agent daily doesn't make any sense - any ideas?
> --
> Gary