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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Sql 2000 to XML

Author  Topic 

Tesdall
Starting Member

7 Posts

Posted - 2010-01-14 : 11:39:21
I know what SQL is, how to install it and point programs to it. I also, know how to a few more things from SQL like set up users and things along those lines. I do not however, really know how to pull information out of SQL.

I have a very basic SQL database that holds our servers name, how much hard drive it has on c d e..etc... i want to pull that information out of sql and display it in XML that a graph generator would then use to ... genereate a graph. I have the graph side finished all i need is the dynamic XML.

I have read on-line how to export SQL 2000 to XML but nothing has been ususer friendly for the first time person like me.

Reference : http://www.databasejournal.com/features/mssql/article.php/2196461/XML-and-SQL-2000-Part-1.htm
and
http://www.15seconds.com/issue/001102.htm
and
http://mdid.org/mdidwiki/index.php?title=How_to_export_data_from_SQL_Server_2000_to_XML

Where ever you go, there you are.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-14 : 11:52:29
the posted details have detailed explanation on how to do it. can i ask what else you're expecting from us?
Go to Top of Page

Tesdall
Starting Member

7 Posts

Posted - 2010-01-14 : 12:58:46
What im expecting, is to dumb it down a ittle more. I understand the coding part. But where do i put the code? How do i run the code, etc...

Where ever you go, there you are.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-14 : 13:00:54
quote:
Originally posted by Tesdall

What im expecting, is to dumb it down a ittle more. I understand the coding part. But where do i put the code? How do i run the code, etc...

Where ever you go, there you are.


you run code in query analyser
Go to Top of Page

Tesdall
Starting Member

7 Posts

Posted - 2010-01-14 : 13:10:59
Thank you for that, im used to 2005 where the QA was built into it. Or atleast that is what i think i remember. So, to find out its a sperate application all together. WHEW... anyways thank you.

I suppose i will try my hand at this. Once im done i will post the code, even though, im sure no one wants it.

Where ever you go, there you are.
Go to Top of Page

Tesdall
Starting Member

7 Posts

Posted - 2010-01-14 : 13:53:14
When i try to do a simple code, just to test to see if i can get it to work, i get an error. Maybe you could help me figure out what im doing wrong.

The DBO is named dbo.ntdisks and the info in the columns that i want to pull the data from are system, drive, data, and free_mb

this is what my simple code looks like

 SELECT System, Drive, Date
FROM dbo.ntdisks
FOR XML Raw


Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbo.ntdisks'.


Could this be a permissions issue? im a domain admin and i added my domain admin account to the public select group. Do i need to do anything else to get to these file?

Where ever you go, there you are.


*update* There was a drop down box at the top of QA that was on master, i had to move it to another Database to get it to show correctly.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-01-14 : 13:59:27
my guess is your in the wrong database...are you running this in SSMS?

What's the name of the database?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Tesdall
Starting Member

7 Posts

Posted - 2010-01-14 : 14:01:43
You are correct, im doing this in QA (query Analyzer)

There was a drop down box at the top of QA that was on master, i had to move it to another Database to get it to show correctly.

quote:
Originally posted by X002548

my guess is your in the wrong database...are you running this in SSMS?

What's the name of the database?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam







Where ever you go, there you are.
Go to Top of Page

Tesdall
Starting Member

7 Posts

Posted - 2010-01-14 : 14:13:40
I have now ran the simple query and was able to pull the data out of SQL. I have a set way i need to the data to go. How do i organize the data better?

This is what i get:
 <row System="server" Drive="C" Date="2008-03-03T00:00:00" Free_MB="11692"/>


I need the data to be like this:

- <categories>
<category label="1/14/2010" />
- <dataset seriesName="C:" color="1D8BD1" anchorBorderColor="1D8BD1" anchorBgColor="1D8BD1">
<set value="317069" />
- <dataset seriesName="D:" color="F1683C" anchorBorderColor="F1683C" anchorBgColor="F1683C">
<set value="422948" />


i read somewhere about xml templates, could that be used in this instance? How would one do that?

Where ever you go, there you are.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-01-14 : 14:20:12
huh?

You just lost me


Post the DDL of your table, and sample data in DML form, and expected results...

OH,
and at the top of your SQL put

USE [<your database name>]
GO



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Tesdall
Starting Member

7 Posts

Posted - 2010-01-14 : 14:37:16
sorry i lost you, that was not my intention.

I will be more than happy to post any information that you reuqire to help me out :) ... what is DDL/DML so that i can get that info to you.

new Script
USE Database
GO

SELECT System, Drive, Date, Free_MB

FROM dbo.NTDisks

FOR XML auto


*update* please note that i am changing some of the data, so as not to leak any "company secerts". Our database is named something else, which is why i placed use "database". Im not a total idiot :p
quote:
Originally posted by X002548

huh?

You just lost me


Post the DDL of your table, and sample data in DML form, and expected results...

OH,
and at the top of your SQL put

USE [<your database name>]
GO



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam





Where ever you go, there you are.
Go to Top of Page
   

- Advertisement -