?
Solved

MS SQL Restore to a different Server with Diffs and different File Names

Posted on 2014-04-16
2
Medium Priority
?
201 Views
Last Modified: 2014-04-16
Hi Experts,

I receive diff file on a daily bases and the challenge I have is the file names are different each time I get a diff backup but only the date.

I'm attemping to the get the following date format for my script 16042014 - ddmmyyyy but I seem to be getting 2014-04-16.
 
set @datestring = convert(NVARCHAR(112),getDate(),23)
0
Comment
Question by:johnojohno
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 400 total points
ID: 40003527
23 isn't a valid date format. If you want ddmmyy try:
select replace(convert(varchar(10), getdate(), 103), '/', '')

Open in new window

0
 

Author Comment

by:johnojohno
ID: 40003541
Thanks bud, this is the working solution. Happy Days

set @datestring = replace(convert(varchar(10), getdate(), 103), '/', '')
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question