Solved

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

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now