Showing posts with label complete. Show all posts
Showing posts with label complete. Show all posts

Thursday, March 29, 2012

Extract a complete XML section and sub sections

Ive been using select statments to get information from each 'section'.
example below shows only for the Header section.
EXEC sp_xml_preparedocument @.hDoc OUTPUT, @.TESTXML
Select * from OpenXML(@.hDoc, '//Header') with
(reportType varchar(10), reportNumber VarChar(6), batchNumber varchar(6),
reportSequenceNumber varchar(6), userNumber varchar(6) )
EXEC sp_xml_removedocument @.hDoc
the following section of the file has sub sections contained within the
Header section, Is there a simple way to return all the data values in one
SQL ?
- <Header reportType="REFT2013" reportNumber="14685" batchNumber="023"
reportSequenceNumber="000760" userNumber="948053">
<ProducedOn time="17:31:38" date="2004-09-27" />
<ProcessingDate date="2004-09-28" />
</Header>
You can specify relative XPaths for the columns in the subelements, as shown
below. Is that what you mean?
DECLARE @.TESTXML nvarchar(2000)
DECLARE @.hDoc integer
SET @.TESTXML =
'<Header reportType="REFT2013" reportNumber="14685" batchNumber="023"
reportSequenceNumber="000760" userNumber="948053">
<ProducedOn time="17:31:38" date="2004-09-27" />
<ProcessingDate date="2004-09-28" />
</Header>'
EXEC sp_xml_preparedocument @.hDoc OUTPUT, @.TESTXML
Select * from OpenXML(@.hDoc, '//Header', 1)
with
(reportType varchar(10),
reportNumber VarChar(6),
batchNumber varchar(6),
reportSequenceNumber varchar(6),
userNumber varchar(6),
ProducedOnTime nvarchar(10) 'ProducedOn/@.time',
ProducedOnDate nvarchar(20) 'ProducedOn/@.date',
ProcessingDate nvarchar(20) 'ProcessingDate/@.date' )
EXEC sp_xml_removedocument @.hDoc
Cheers,
Graeme
--
Graeme Malcolm
Principal Technologist
Content Master Ltd.
www.contentmaster.com
"Peter Newman" <PeterNewman@.discussions.microsoft.com> wrote in message
news:4CD137BC-09E8-42A8-BC86-6C6991EA979C@.microsoft.com...
Ive been using select statments to get information from each 'section'.
example below shows only for the Header section.
EXEC sp_xml_preparedocument @.hDoc OUTPUT, @.TESTXML
Select * from OpenXML(@.hDoc, '//Header') with
(reportType varchar(10), reportNumber VarChar(6), batchNumber
varchar(6),
reportSequenceNumber varchar(6), userNumber varchar(6) )
EXEC sp_xml_removedocument @.hDoc
the following section of the file has sub sections contained within the
Header section, Is there a simple way to return all the data values in one
SQL ?
- <Header reportType="REFT2013" reportNumber="14685" batchNumber="023"
reportSequenceNumber="000760" userNumber="948053">
<ProducedOn time="17:31:38" date="2004-09-27" />
<ProcessingDate date="2004-09-28" />
</Header>
sql

Sunday, February 26, 2012

Express Edition SP2 - How long to wait for complete installation?

Just curious if there's a reason why everytime I try to apply the Microsoft SQL Server 2005 Express Edition Service Pack 2 from Windows Update that it will sit at "Installing" and appear to do nothing (no hard drive activity, but the MSI and setup processes are chewing a little bit of CPU time). How long should I give this update to complete? I am running a 2-CPU dual-core Xeon 3.0GHz w/ 2GB of RAM setup, so I would have thought it would be completed very quickly. :(

Edit:

Disregard; I had to wait for a full 15 minutes! :OFifteen minutes isn't a 'unusual' amount of time. Depends upon what activity is occuring on the computer.|||I was surprised because nothing else was chewing CPU and Firefox was the only other application open besides IE7 running the Microsoft Update.

Friday, February 17, 2012

exporting to csv

Hi
have had a look this morning through previous postings but cant quite find
what Im looking for, as a complete beginner to reporting services Im a bit
behind in how to do things and where configurations are set
what I have is a report that needs to be approved by human eye before being
exported(csv) for import to financial package
what I want to do is have a lot of information in the report to aid the
manual check(name,address etc), but then only export the information required
for the import(account number,amount) when the user selects the export option
if someone could point me in the general direction I would be grateful
many thanks
STuartHere is how I do this. Create your report as normal. Then copy it and remove
all the extraneous stuff so all you have is. For CSV you really want to only
have a table, don't have any extra fields on the report. Then at the top of
the page of the first report have a textbox. Have the text say something
like, Export Data, underline it and make it blue. Right mouse click
properties, advanced properties, navigation, jump to URL. Call the second
report (I hide this report in list view so the user doesn't normally see
it). In my case I wanted it to come up in another window automatically
(which pulls it up into Excel if you click open, in your case they would
click save and save to whatever filename they want).
="javascript:void(window.open('" & Globals!ReportServerUrl &
"?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
"&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
A few things to note, I specify ASCII because the default is Unicode. I
assume you want ASCII. If you want unicode then just leave off that part.
Also be sure to be careful with the parameters, the parameter names are case
sensitive.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Stuart" <Stuart@.discussions.microsoft.com> wrote in message
news:FF0C86A2-D53C-4EE1-B952-3C7DE218B0E3@.microsoft.com...
> Hi
> have had a look this morning through previous postings but cant quite find
> what Im looking for, as a complete beginner to reporting services Im a bit
> behind in how to do things and where configurations are set
> what I have is a report that needs to be approved by human eye before
> being
> exported(csv) for import to financial package
> what I want to do is have a lot of information in the report to aid the
> manual check(name,address etc), but then only export the information
> required
> for the import(account number,amount) when the user selects the export
> option
> if someone could point me in the general direction I would be grateful
> many thanks
> STuart