The date datatype doesn't have a concept of a format. It's just a moment in time perhaps with a timezone attached but without any particular fixed representation. When you format it, it becomes a varchar. If you cast the varchar back to a date, it loses the format. This will be pretty much the same in any programming language that has a native date datatype (or date/datetime objects). It's not specific to SQL.
If you want a particular string representation of a date, then you want a varchar, so don't try to cast it back to a date.
This seems to be what's called an XY problem. What is wrong with CONVERT(varchar(12), GETDATE(), 103)? Yes, it's a varchar, but what's why are you unsatisfied with it being a varchar?
Convert Date mm/dd/yyyy in to yyyymmdd - SQL Server Forums
Convert getdate() to dd/mm/yyyy in SQL Server - Stack Overflow
convert date ( yyyy-mm-dd) to (mm-dd-yyyy) - SQL Server Forums
How to change date format from YYMMDD to DD-MM-YYYY
Videos
That task should be done by the next layer up in your software stack. SQL is a data repository, not a presentation system
You can do it with
CONVERT(VARCHAR(10), fmdate(), 101)
But you shouldn't
select convert(varchar(10), fmdate, 101) from sery
101 is a style argument.
Rest of 'em can be found here.
CAST and CONVERT (Transact-SQL) - Date and time styles
I understand your problem to be how to successfully convert the string into a DATE value. An undelimited string of integers is assumed to be Year-Month-Day order. (And, of course, I agree with the comments that dates should be stored in DATE data types in the database.)
Reviewing the MSDN CONVERT documentation does not show a built-in conversion for your string, but it is easy to work around.
http://msdn.microsoft.com/en-us/library/ms187928.aspx -- CAST and CONVERT
I changed the month to 8 to make it easier to double check. Using the CONVERT style option 3, you can do the following:
DECLARE @String VARCHAR(10);
DECLARE @DateValue DATE;
SET @String = '250809';
-- Convert your undelimited string DDMMYY into a DATE
-- First: Add / between the string parts.
SET @STRING = SUBSTRING(@String,1,2)+'/'+
SUBSTRING(@String,3,2)+'/'+SUBSTRING(@String,5,2);
-- Second: Convert using STYLE 3 to get DD/MM/YY interpretation
SELECT @DateValue = CONVERT(Date, @String, 3);
-- Using the DATE
-- Select the value in default Year-Month-Day
SELECT @DateValue AS DefaultFormat;
-- Select the value formatted as dd/mm/yy
SELECT CONVERT(VARCHAR(20),@DateValue,3) AS [DD/MM/YY];
The results of the last two selects are:
DefaultFormat
-------------
2009-08-25
DD/MM/YY
--------
25/08/09
To get your DATE formatted in the way you want it, you have to insert the '/' delimiters then use the STYLE 3 in converting from the string to the DATE. (I am sure that there are other workarounds and conversion styles that would work as well.)
Likewise when displaying the DATE as you desire, you need to use STYLE 3
Another approach is to cast it directly to a date in SQL Server 2008 or above, then store it that way as @ypercube commented above. Assuming 2000 <= all expected years <= 2099:
DECLARE @d CHAR(6) = '250909';
SELECT DATEFROMPARTS('20'+RIGHT(@d,2),SUBSTRING(@d,3,2),LEFT(@d,2));
You may need to do things a little differently if you could have 250999 etc, then you would need some way to indicate whether that's 1999 or 2099, for example. This also doesn't handle validation (like the other answer, it will choke on values like 252525).
When you want to display the date, then format it at the display/presentation layer, but store it correctly in the database. I still question whether it is actually useful to display as ambiguous formats like 25/09/2009 - for that date specifically it's clearly September 25th, but are you sure your entire audience will always get 07/08/2009 correctly? While I'm in the USA that's July 8th, but last week I was in Canada, and I would expect that to be August 7th. Output formats like 2009-07-08 are much clearer and less prone to misinterpretation; even better would be July 8th, 2009 - but then that opens the door to folks using a different language. All that said, these formats can be completely controlled by the client application (C# has very powerful formatting functions), and shouldn't dictate how you actually store the data in the database. They should be stored as dates because you get automatic validation, all of the date/time functionality, etc. Stop storing dates as strings (and maybe even try to get the CSV to contain more reliable literal formats, like YYYYMMDD). Some useful reading perhaps:
https://sqlblog.org/2009/10/12/bad-habits-to-kick-choosing-the-wrong-data-type
https://sqlblog.org/2009/10/16/bad-habits-to-kick-mis-handling-date-range-queries