locked
SQlfunction to check date RRS feed

  • Question

  • Hi

    I need to have a second copy of our databse on another server as backup if something will happen to the first one.

    I couldn´t get the sql replication or database mirror to work ( I think the problem i that both servers are running in a workgroup an dnot in a domaine) and now I try to solved my problem with an automatic restore of the full backup (a new full backup is running every night) but now I need a function to check if todays date is the same as a part of the backupfilename and is it possible to do that as a step in the sqlagentjob i have create?

     

    Thanks for any help how I can do that

    Monday, September 10, 2007 12:10 PM

Answers

  • Hi

    I have solved the problem with xp_fileexist and "select Convert(varchar(10),GETDATE(),112).

    Thanks for your respons

    Wednesday, September 12, 2007 9:02 AM

All replies

  • It shouldn't be too difficult to check whether the datepart of your filename is the same as todays date.

    I assume you have some sort of namingstandard on those files?

    Could you show what a typical filename would look like?

     

    /Kenneth

     

    Wednesday, September 12, 2007 8:58 AM
  • Hi

    I have solved the problem with xp_fileexist and "select Convert(varchar(10),GETDATE(),112).

    Thanks for your respons

    Wednesday, September 12, 2007 9:02 AM