Solved

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

Posted on 2014-04-16
2
199 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 100 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL trigger 5 50
How can I use this function? 3 35
SQL server client app 3 75
SQL syntax question 6 72
Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…

734 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