Showing posts with label situation. Show all posts
Showing posts with label situation. Show all posts

Friday, March 30, 2012

New to SQL - Backup Fails

Bear with me, as I am new to SQL and have quite simply been thrown into this situation.

I have set up a simple backup to DVD that fails. The log file is attached. I'm sure that there's an obvious answer here, but I don't know what to look for. Until we find a new database guy, I'm it.

Thansk so much in advance for any insight you can provide!

TomWhy to a DVD(?) Why not to disk? It's faster...

And if you're it (Like in tag?) then why not use the maintenance wizard?|||well, your errors relate to what you're asking in the first command, - set db to single user mode. if there is at least one more connection (which can be even yours0 the command will fail. you can write a simple script that would create a script that kills all connections to that database. fire that script before running sqlmaint and set a job step dependency "on success" with sqlmaint step.|||Just to be clear: ms_sql_dba is right; your job is failing because your database is not in single user mode. SQL backups can run with multiple users logged in, but in your case, the first task in your job is to "repair" the database.

I'm guessing that you are using the maintenance wizard; if so, skip the Integrity page on the maintenance wizard (make sure nothing is checked).

After doing that, your job should run okay.

Regards,

hmscott|||Thanks to all or you for your help.

Skipping the integrity page in the maintenance wizard cleared it up!

Hopefully I won't have to do this very long!

Regards,

Tom

Monday, March 19, 2012

new records in table

i have a situation where i have table A with 50 records, )with no timestamp column). Data will be appended to it on a constant basis, daily. how can you filter out the new records?

Can you please post the schema of the table or a sample of it? Does it have an identity column for example? If so, you could capture the MAX identity value after every day and determine the new rows. But this will only give rows that were added not modified. You can use similar approach if you have a key that has some time part in it. But this all depends on your data. Often it is best to use staging table approach so that you don't have to go to the main table(s). You can insert first into the staging table and then update the main table. This will allow you to do additional processing using the rows from the staging table.