Solved

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
In this article I will describe the Detach & Attach 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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

735 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