Copying a SQL 2005 database

  • I have been working a program for a local country club involving their GHIN golf database. The program is to help calculate tournament handicaps based on tournament play versus regular play. The handicaps of their players are recalculated on a bi-weekly basis. As part of my testing of my program the club e-mails me a copy of their newest SQL database files every two weeks. About every other week when I try access the tables with my program I get an error that indicates that the database was not shutdown cleanly. I have instructed them to make sure that their handicap program has been properly exited before making a copy of the data files. Every time I have this issue I have them send another copy and that usually fixes the problem. I have not had to make changes in my program each time; I just have them send a new copy of the same database.

    What are some of the possible situations or causes that would have a (my) program see that database as dirty. Could it be an issue with the way they are copying the database?

    Dave W.

  • I'm not sure how they take the database copy but usually I would suggest to take a backup of the database to restore on your system.

  • Good question. I called the club and the golf department manager indicated that he just exits the GHIN Handicap problem using the normal exit procedure using the File - Exit menu. He then goes into the Windows Task Manager and "ends" all sqlserver.exe instances. Next he copies the contents of the program's SQL "Data" folder to the desktop in a new folder named for the current date and then e-mails me the zipped folder of ten files SQL files.

    Dave W.

  • davew01 (5/22/2009)


    Good question. I called the club and the golf department manager indicated that he just exits the GHIN Handicap problem using the normal exit procedure using the File - Exit menu. He then goes into the Windows Task Manager and "ends" all sqlserver.exe instances. Next he copies the contents of the program's SQL "Data" folder to the desktop in a new folder named for the current date and then e-mails me the zipped folder of ten files SQL files.

    Dave W.

    :w00t:

    Kill sqlserver.exe by task manager? Never heard this approach to copy databases. Provide a stored procedure which creates a usual SQL Server backup to a specified directory (maybe deletes older versions) and add a button to your app which executes this procedure. After the backup is done let them copy the backup. Keep SQL Server alive, it's a friend not an enemy which needs to be killed :-D.

  • Florian - I like the approach of providing a procedure to properly backup the DB from a desktop icon. Thanks for your help in this matter.

    Dave W.

  • davew01 (5/22/2009)


    Good question. I called the club and the golf department manager indicated that he just exits the GHIN Handicap problem using the normal exit procedure using the File - Exit menu. He then goes into the Windows Task Manager and "ends" all sqlserver.exe instances. Next he copies the contents of the program's SQL "Data" folder to the desktop in a new folder named for the current date and then e-mails me the zipped folder of ten files SQL files.

    Dave W.

    Ouch. In addition to Flo's suggestion to wrap this into a procedure and whatnot, you might want to think about adding that and some other maintenance type tasks as jobs to help them recover when they have an issue. If they keep killing it with task manager they will have an issue, and probably sooner rather than later.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • I have to agree with Flo and Luke.

  • I am Facing the Same Issue

  • sheetaljain22 (5/23/2009)


    I am Facing the Same Issue

    Plzz Help Today is My Last Day Of my Proj

  • Which kind of problem do you mean?

  • Most flavors of a SAN come with "snapshot" capabilites that solve these types of problems.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (5/23/2009)


    Most flavors of a SAN come with "snapshot" capabilites that solve these types of problems.

    SAN? Since the OP wrote that the database "backup" will be send by email I don't think there is a SAN. 😀

  • sheetaljain22 (5/23/2009)


    sheetaljain22 (5/23/2009)


    I am Facing the Same Issue

    Plzz Help Today is My Last Day Of my Proj

    What precisely is the problem? What are you trying to do, what is the background and what is not working that you think should be working?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 13 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic. Login to reply