Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

querry get data in double codes in string Expand / Collapse
Author
Message
Posted Sunday, February 9, 2014 7:05 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, July 17, 2014 5:46 AM
Points: 68, Visits: 293
Hi all

i have data like this

"entitlementwrapper" : [ {
"Type" : "Factory Warranty",
"Date_Type" : "Ship date",
"Status" : "Active",
"Start_Date" : "2012-12-21",
"End_Date" : "2014-01-19",
"Days_Left" : "116",
"Term" : "13",
"Description" : "Wty: HP HW Replacement Support",
"IsTrusted" : "Y",
"Transaction_ID" : "4644780453"

}

i want to get only data in double codes in using sql querry

thanks,
Pradeep
Post #1539562
Posted Sunday, February 9, 2014 7:18 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: 2 days ago @ 8:36 AM
Points: 4,319, Visits: 6,112
Please provide several sample sets of data and the corresponding table output you expect (with column data types). That's JSON, yes?

Best,

Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru at GMail
Post #1539563
Posted Sunday, February 9, 2014 7:06 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 7:07 PM
Points: 36,735, Visits: 31,185
mpradeep23 (2/9/2014)
Hi all

i have data like this

"entitlementwrapper" : [ {
"Type" : "Factory Warranty",
"Date_Type" : "Ship date",
"Status" : "Active",
"Start_Date" : "2012-12-21",
"End_Date" : "2014-01-19",
"Days_Left" : "116",
"Term" : "13",
"Description" : "Wty: HP HW Replacement Support",
"IsTrusted" : "Y",
"Transaction_ID" : "4644780453"

}

i want to get only data in double codes in using sql querry

thanks,
Pradeep


If given the data above, precisely what do you want for an output?


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1539613
Posted Sunday, February 9, 2014 7:09 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 7:07 PM
Points: 36,735, Visits: 31,185
TheSQLGuru (2/9/2014)
Please provide several sample sets of data and the corresponding table output you expect (with column data types). That's JSON, yes?


THAT's JSON? Shoot... that's just as bad or worse than attribute based XML. We need a few more "standards" for passing simple data.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1539614
Posted Sunday, February 9, 2014 9:19 PM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: 2 days ago @ 8:36 AM
Points: 4,319, Visits: 6,112
Jeff Moden (2/9/2014)
TheSQLGuru (2/9/2014)
Please provide several sample sets of data and the corresponding table output you expect (with column data types). That's JSON, yes?


THAT's JSON? Shoot... that's just as bad or worse than attribute based XML. We need a few more "standards" for passing simple data.


I personally feel that JSON is MUCH worse than XML (and I frickin' HATE XML, so that should tell you something), but alas JSON has taken over and we are just going to have to learn to make the best of it.


Best,

Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru at GMail
Post #1539619
Posted Sunday, February 9, 2014 9:31 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 7:07 PM
Points: 36,735, Visits: 31,185
TheSQLGuru (2/9/2014)
Jeff Moden (2/9/2014)
TheSQLGuru (2/9/2014)
Please provide several sample sets of data and the corresponding table output you expect (with column data types). That's JSON, yes?


THAT's JSON? Shoot... that's just as bad or worse than attribute based XML. We need a few more "standards" for passing simple data.


I personally feel that JSON is MUCH worse than XML (and I frickin' HATE XML, so that should tell you something), but alas JSON has taken over and we are just going to have to learn to make the best of it.


Ah, my friend. I've found a kindred spirit. You've made my day and maybe the whole bloody week!


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1539621
Posted Sunday, February 9, 2014 10:07 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 7:44 PM
Points: 21,209, Visits: 14,899
Jeff Moden (2/9/2014)
TheSQLGuru (2/9/2014)
Jeff Moden (2/9/2014)
TheSQLGuru (2/9/2014)
Please provide several sample sets of data and the corresponding table output you expect (with column data types). That's JSON, yes?


THAT's JSON? Shoot... that's just as bad or worse than attribute based XML. We need a few more "standards" for passing simple data.


I personally feel that JSON is MUCH worse than XML (and I frickin' HATE XML, so that should tell you something), but alas JSON has taken over and we are just going to have to learn to make the best of it.


Ah, my friend. I've found a kindred spirit. You've made my day and maybe the whole bloody week!


Make that three against JSON.

Had a project once where they required us to convert JSON to XML, then normalize and import into the database, then believe it or not - reconvert the normalized data into a JSON string to also be stored.

They didn't like that we shortcuted and just passed the JSON string to the database rather than converting it from normalized back to JSON. But they learned to accept it (they being those who came up with the stinking requirement).




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1539627
Posted Monday, February 10, 2014 6:21 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, July 17, 2014 5:46 AM
Points: 68, Visits: 293
hi

i need out put as

type Start_Date End_Date
Factory Warranty 2012-12-21 2014-01-19


thanks,
pradeep
Post #1539721
Posted Monday, February 10, 2014 9:19 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: 2 days ago @ 8:36 AM
Points: 4,319, Visits: 6,112
mpradeep23 (2/10/2014)
hi

i need out put as

type Start_Date End_Date
Factory Warranty 2012-12-21 2014-01-19


thanks,
pradeep


Do you need to actually STORE this data inside SQL Server first (the original record) and then later you want to be able to create the output you list above with a SELECT statement? And if so, does that output eventually get converted into JSON format or does it get consumed in Tabular Datastream format? We need you to provide us with more details so we can help you more effectively!


Best,

Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru at GMail
Post #1539812
Posted Monday, February 10, 2014 10:29 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, July 17, 2014 5:46 AM
Points: 68, Visits: 293
Hi

i have table called t1

with column name offers with data as

"entitlementwrapper" : [ {
"Type" : "Factory Warranty",
"Date_Type" : "Ship date",
"Status" : "Active",
"Start_Date" : "2012-12-21",
"End_Date" : "2014-01-19",
"Days_Left" : "116",
"Term" : "13",
"Description" : "Wty: HP HW Replacement Support",
"IsTrusted" : "Y",
"Transaction_ID" : "4644780453"
},

i want to get data to store in other table
1.type
2.start_date
3.end_date

i need queery to load data into this table

thanks,
Pradeep

Post #1539867
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse