Showing posts with label resources. Show all posts
Showing posts with label resources. Show all posts

Monday, March 19, 2012

How to load XML from filename and path

Hi,

I have inherited a database that has a table called "Resources" that contains a field called "FilePath". FilePath is a VarChar(100) and contains the server path and filename of an XML file on the server hard disk.

I need to join the data in the XML with rows in the "Resources" table (and other tables).

Is it possible to get a Stored Procedure to load the XML file into a temporary table?

Is loading it into a table the best way to do it - or can I join directly to the XML file somehow?

What is the best approach? (I know nothing about XML in SQL Server yet)

Thanks in advance,

Chiz.

Try the link below to use OPENXML in SQL Server, I am not sure about Temp tables I would try it to see if it is possible, just remember to drop the temp table explictly. Hope this helps.
http://msdn.microsoft.com/msdnmag/issues/05/06/DataPoints/default.aspx|||Thanks Caddre,
At the moment the .NET code calls a Stored Procedure which JOINs the Resources table with some other tables and returns the result which goes into a DataSet.
In order to build a DataSet that can be displayed in a DataGrid the DataSet has to be looked at (one row at a time) and the FilePath 'field' used to load the XML file from disk into an XmlDocument. Then the right data in the right node has to be found and then finally when that is found it can be added to the DataSet.
Anyway, to cut a long story short, I reckon that if I can somehow get T-SQL to load an XML file from disk into a temporary table that it will be neater and more efficient.
Any other help appreciated,
Chiz.|||

The text below is from the BOL(books online) sp_xml_preparedocument System stored Procedure can be used, run a search for sp_xml_preparedocument in the BOL (books online). Hope this helps

(sp_xml_preparedocument
Reads the Extensible Markup Language (XML) text provided as input, then parses the text using the MSXML parser (Msxml2.dll), and provides the parsed document in a state ready for consumption. This parsed document is a tree representation of the various nodes (elements, attributes, text, comments, and so on) in the XML document.)

Friday, February 24, 2012

How to know What Query Statement that consume the Server resources

Hi all,
We have problem with SQL Server 2000 : there something in the
application that cause the server out of memory. I suspect this is
because an inefficient and heavy query.
In Oracle we have TOP SQL from Enterprise Manager to see what query
that consume the server resources most, How can I get that information
in SQL Server 2000 ?
Thank you for your help,
KristHi
It is possible that long running queries and /or queries that performs lots
READs are consumed resources. SQL Server Profiler tool is your friend
<krislioe@.gmail.com> wrote in message
news:157f6947-088e-4bf7-bcad-753ceff7be3c@.s37g2000prg.googlegroups.com...
> Hi all,
> We have problem with SQL Server 2000 : there something in the
> application that cause the server out of memory. I suspect this is
> because an inefficient and heavy query.
> In Oracle we have TOP SQL from Enterprise Manager to see what query
> that consume the server resources most, How can I get that information
> in SQL Server 2000 ?
> Thank you for your help,
> Krist
>|||To really get a look at the internals of SQL executions and resource usage
you need to be on SQL 2005+. Not much info available in 2000.
--
Kevin G. Boles
Indicium Resources, Inc.
SQL Server MVP
kgboles a earthlink dt net
<krislioe@.gmail.com> wrote in message
news:157f6947-088e-4bf7-bcad-753ceff7be3c@.s37g2000prg.googlegroups.com...
> Hi all,
> We have problem with SQL Server 2000 : there something in the
> application that cause the server out of memory. I suspect this is
> because an inefficient and heavy query.
> In Oracle we have TOP SQL from Enterprise Manager to see what query
> that consume the server resources most, How can I get that information
> in SQL Server 2000 ?
> Thank you for your help,
> Krist
>

Sunday, February 19, 2012

How to know how many users are connected to my sql server 2000 and how many resources are

how can i know it? can i do it with sql 2000 tools or i need other kind of
tool?
Regards
Rick
EXEC master.dbo.sp_who2;
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"Rick" <zatankloz@.gmail.com> wrote in message
news:%23aXjgLGqHHA.2044@.TK2MSFTNGP04.phx.gbl...
> how can i know it? can i do it with sql 2000 tools or i need other kind of
> tool?
> Regards
> Rick
>
|||Hello,
For SQL 2000 query the MASTER..SYPROCESSES table. Use the filtering and
group based on your requirement.
For SQL 2005 you could the dynamic management view (DMV)
sys.dm_exec_sessions
SELECT
session_id,login_name,
last_request_end_time,cpu_time
FROM sys.dm_exec_sessions
WHERE session_id >= 51 - All user SessionsSee the below URL for more
details:-
http://www.codeproject.com/useritems/Dynamic_Management_Views.asp
Thanks
Hari
"Rick" <zatankloz@.gmail.com> wrote in message
news:%23aXjgLGqHHA.2044@.TK2MSFTNGP04.phx.gbl...
> how can i know it? can i do it with sql 2000 tools or i need other kind of
> tool?
> Regards
> Rick

>

How to know how many users are connected to my sql server 2000 and how many resources are

how can i know it? can i do it with sql 2000 tools or i need other kind of
tool?
Regards
RickEXEC master.dbo.sp_who2;
--
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"Rick" <zatankloz@.gmail.com> wrote in message
news:%23aXjgLGqHHA.2044@.TK2MSFTNGP04.phx.gbl...
> how can i know it? can i do it with sql 2000 tools or i need other kind of
> tool?
> Regards
> Rick
>|||Hello,
For SQL 2000 query the MASTER..SYPROCESSES table. Use the filtering and
group based on your requirement.
For SQL 2005 you could the dynamic management view (DMV)
sys.dm_exec_sessions
SELECT
session_id,login_name,
last_request_end_time,cpu_time
FROM sys.dm_exec_sessions
WHERE session_id >= 51 - All user SessionsSee the below URL for more
details:-
http://www.codeproject.com/useritems/Dynamic_Management_Views.asp
Thanks
Hari
"Rick" <zatankloz@.gmail.com> wrote in message
news:%23aXjgLGqHHA.2044@.TK2MSFTNGP04.phx.gbl...
> how can i know it? can i do it with sql 2000 tools or i need other kind of
> tool?
> Regards
> Rick
>