Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
I need help pulling data from a Table into xml file. I need this data to be updated daily. So, I can always have the latest data from the SQL Table. Any idea of how to do this. Thank you for the help.
slimt_slimt
Aged Yak Warrior
746 Posts
Posted - 2010-05-03 : 15:51:33
a simple example:
create table AB (te_xt varchar(10) ,te_xt2 varchar(20) ) insert into AB select 'text9','text6' union all select 'text2','text4' union all select 'text3','text5' select te_xt ,te_xt2 ,'' as rownumber from AB SELECT te_xt, te_xt2FROM ABFOR XML PATHgo
prepare the select query on daily basis in such way to generate xml. Using SSIS package you can save this into XML file.
osirisa
Constraint Violating Yak Guru
289 Posts
Posted - 2010-05-03 : 16:02:02
Ok. Maybe it will help if I give you the table structure. Table ResponsibilitiesColumn 1 --Code, Column 2 --Application,Column 3 --Responsibility,Column 4 --Description.How to import this columns into xml file. Then how to update this xml file on the daily basic. I need to export this file inside a program that will read this file to populate a dropdownlist. Thank you for your help.
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts
Posted - 2010-05-03 : 16:42:25
quote:I need to export this file inside a program that will read this file to populate a dropdownlist. Thank you for your help.
Maybe I'm missing something, but why not populate the dropdown directly by reading the table?
SwePeso
Patron Saint of Lost Yaks
30421 Posts
Posted - 2010-05-03 : 16:53:26
Any chance you can post the layout of the XML document?N 56°04'39.26"E 12°55'05.63"
osirisa
Constraint Violating Yak Guru
289 Posts
Posted - 2010-05-03 : 16:58:08
Good Point.....I am trying to avoid the postback action. If I read the table, I have to do a postback.
osirisa
Constraint Violating Yak Guru
289 Posts
Posted - 2010-05-03 : 17:00:02
If I read directly from the Table, I have to do a postback. If I stored the information inside xml file everything is in the client side.
osirisa
Constraint Violating Yak Guru
289 Posts
Posted - 2010-05-03 : 17:01:35
The xml file will look something like this.-----------------------------------------------------------<code> <dbo.GSP_Responsibilities_and_Approvers_2 RESPONSIBILITY_NAME="DR SYS Help Desk Admin" RESPONSIBILITY_KEY="DR-HELP DESK" /> <dbo.GSP_Responsibilities_and_Approvers_2 RESPONSIBILITY_NAME="DR SYS Help Desk Reset Pwd" RESPONSIBILITY_KEY="DR_SYS_HELP_DESK_RESET_PWD" /> <dbo.GSP_Responsibilities_and_Approvers_2 RESPONSIBILITY_NAME="DR SYS System Administrator Inquiry" RESPONSIBILITY_KEY="DR_SYS_SYSTEM_ADMIN_INQUIRY" /></code>