Showing posts with label job. Show all posts
Showing posts with label job. Show all posts

Wednesday, March 28, 2012

I deleted an important database by accident!

I just got a new job at a new company, and I had a network terminal
with sql server which accessed a list of databases. One of them was
the database I was expected to work with.
The first day I opened some stored procedures and some tables to get a
feel of how the database worked.
The next day, the database was gone.
I am new to SQL Server (though I've read books on it) and I wonder if
I deleted the database by mistake. For instance, I double clicked on
some of the stored procedures to open them. Perhaps that runs them
instead of opening them and they delete the database? (Some of the
procedures I clicked on were 'system procedures')
I would think that it would not be simple to delete a database by
mistake - I would expect at least a message saying "are you sure"?
Monday I come back to face the music - so does anybody know how this
could happen?
-- MarvinHi
No , If you double click on stored procedure that won't drop the database as
you describe that.
Yes , if ou delete the db via EM , it always asks you "are you sure...."
bit not if you run DROP DATABASE... via QA.
Also , if some users were connected to the db you also get a message that
'db is in use..."
<COHENMARVIN@.lycos.com> wrote in message
news:67a8223a-4a1c-4eff-9ea8-9eb32417a0b8@.8g2000hse.googlegroups.com...
>I just got a new job at a new company, and I had a network terminal
> with sql server which accessed a list of databases. One of them was
> the database I was expected to work with.
> The first day I opened some stored procedures and some tables to get a
> feel of how the database worked.
> The next day, the database was gone.
> I am new to SQL Server (though I've read books on it) and I wonder if
> I deleted the database by mistake. For instance, I double clicked on
> some of the stored procedures to open them. Perhaps that runs them
> instead of opening them and they delete the database? (Some of the
> procedures I clicked on were 'system procedures')
> I would think that it would not be simple to delete a database by
> mistake - I would expect at least a message saying "are you sure"?
> Monday I come back to face the music - so does anybody know how this
> could happen?
> -- Marvin

I deleted an important database by accident!

I just got a new job at a new company, and I had a network terminal
with sql server which accessed a list of databases. One of them was
the database I was expected to work with.
The first day I opened some stored procedures and some tables to get a
feel of how the database worked.
The next day, the database was gone.
I am new to SQL Server (though I've read books on it) and I wonder if
I deleted the database by mistake. For instance, I double clicked on
some of the stored procedures to open them. Perhaps that runs them
instead of opening them and they delete the database? (Some of the
procedures I clicked on were 'system procedures')
I would think that it would not be simple to delete a database by
mistake - I would expect at least a message saying "are you sure"?
Monday I come back to face the music - so does anybody know how this
could happen?
-- Marvin
Hi
No , If you double click on stored procedure that won't drop the database as
you describe that.
Yes , if ou delete the db via EM , it always asks you "are you sure...."
bit not if you run DROP DATABASE... via QA.
Also , if some users were connected to the db you also get a message that
'db is in use..."
<COHENMARVIN@.lycos.com> wrote in message
news:67a8223a-4a1c-4eff-9ea8-9eb32417a0b8@.8g2000hse.googlegroups.com...
>I just got a new job at a new company, and I had a network terminal
> with sql server which accessed a list of databases. One of them was
> the database I was expected to work with.
> The first day I opened some stored procedures and some tables to get a
> feel of how the database worked.
> The next day, the database was gone.
> I am new to SQL Server (though I've read books on it) and I wonder if
> I deleted the database by mistake. For instance, I double clicked on
> some of the stored procedures to open them. Perhaps that runs them
> instead of opening them and they delete the database? (Some of the
> procedures I clicked on were 'system procedures')
> I would think that it would not be simple to delete a database by
> mistake - I would expect at least a message saying "are you sure"?
> Monday I come back to face the music - so does anybody know how this
> could happen?
> -- Marvin

Monday, March 12, 2012

I am trying to schedule a job not to run on holidays in SQL server 2005.

Hi,

I want to schedule a job that runs daily but not on holidays and I am using SQL server 2005. Looking for some advice...

thanks,

Include an additional step in the job and check within a stored procedure against a vacation table (which has to be built on your own). If the job is within vacation time, throw an error with raiserror and the appropiate message. Check the status of the job step to use the "Stop executing the job after an error".

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Do you mean even in Saturdays and Sundays?

You can schedule a job to run between Monday to Friday on weekly basis, and for any additional holiday requirement you need to follow what is suggested above.

|||Thanks for replying. I will try.|||as a variation on this theme, you could set up a seperate job that disables or enables jobs depending on whether a day is holiday or not. More risky, perhaps (if it doesn't run, then X jobs are not set correctly).