August 13, 2016 at 10:48 am
am working in dev environment sql server 2012. Need to create a date from 'snapshot month' (6) and 'snapshot year' (2016). Found DATEFROMPARTS() function works but wondering if that will continue to work into the future if prod goes 2016.
eg.
DATEFROMPARTS (snapshotyear, snapshotmonth, 1) makedatefromparts
--Quote me
August 13, 2016 at 11:58 am
polkadot (8/13/2016)
am working in dev environment sql server 2012. Need to create a date from 'snapshot month' (6) and 'snapshot year' (2016). Found DATEFROMPARTS() function works but wondering if that will continue to work into the future if prod goes 2016.eg.
DATEFROMPARTS (snapshotyear, snapshotmonth, 1) makedatefromparts
works for me in
Microsoft SQL Server 2016 (RTM) - 13.0.1601.5 (X64) Apr 29 2016 23:23:58 Copyright (c) Microsoft Corporation Developer Edition (64-bit) (Build 10586: )
declare @snapshotyear int = 2016
declare @snapshotmonth int = 6
SELECT DATEFROMPARTS (@snapshotyear, @snapshotmonth, 1) makedatefromparts
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
August 13, 2016 at 12:24 pm
thanks for checking.
--Quote me
August 13, 2016 at 6:54 pm
https://msdn.microsoft.com/en-us/library/hh213228.aspx
Pertenant part:
THIS TOPIC APPLIES TO: SQL Server (starting with 2012)
, and there't no "This feature is deptecated" block at the top
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 14, 2016 at 12:30 am
I failed to mention how I'd checked etc.
Usually all versions are listed in drop down, so it's inconsistent for them to only list 2012, and lack of deprecated doesn't mean it's not. Gail - I guess you believe in the infallibility of Microsoft.
--Quote me
August 14, 2016 at 4:57 am
polkadot (8/14/2016)
Usually all versions are listed in drop down, so it's inconsistent for them to only list 2012
That's the previous version of MSDN. It's been changed (though spme of the pre-2012 pages are still floating around) They now list the version the feature was added in, as well as whether it works in Azure SQLDB, Azure SQLDW or PDW and whether it's deprecated or not. There's too many versions and forms of SQL to have seperate pages for the same feature for each version.
And seeing as I've reported a whole pile of docs bugs over the last year, no I don't expect MS to be infallibil, but they do correct the docs quickly when things are wrong, and stuff that's deprecated does get flagged.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply