Created
January 25, 2017 00:12
-
-
Save bertwagner/29dbdb77052771f5f4f35a7bcc0b9409 to your computer and use it in GitHub Desktop.
SQL Server 2016 JSON's FOR JSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Create our table with test data | |
DROP TABLE IF EXISTS ##Garage; | |
CREATE TABLE ##Garage | |
( | |
Id int IDENTITY(1,1), | |
Make varchar(100), | |
BaseModel varchar(50), | |
Trim varchar(50), | |
Year int, | |
PurchaseDate datetime2 | |
); | |
INSERT INTO ##Garage VALUES ('Volkswagen', 'Golf', 'GL', 2003, '2006-10-05'); | |
INSERT INTO ##Garage VALUES ('Subaru', 'Impreza', 'Premium', 2016, '2015-08-18'); | |
-- Take a look at our data | |
SELECT * FROM ##Garage; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment