Creating XML Output...unusual/impossible Format?
Sep 23, 2005
Hi all,
I'm Trying to replicate the creation of an "xml" file that is currently created using a C++ application. I want to take that application out of the picture, but need to create the same format XML file because a step later in the production process uses this file, and I cannot change it.
The output format I am looking for is:<?xml version="1.0" encoding="utf-8"?>
<FUNDS>
<AMRGX>
<NAME>AMERICAN GROWTH D</NAME>
</AMRGX>
<AHERX>
<NAME>AMERICAN HERITAGE FUND</NAME>
</AHERX>
<AMRVX>
<NAME>AMERICAN INVESTORS GROWTH FUND</NAME>
</AMRVX>
.
.
.
</FUNDS>The problem I am having is that I cannot seem to get the level/node of the fund symbol (AMRGX, AHERX, and AMRVX in the example above) as it needs to be. I think this must be some non-standard use of XML, since the tag is really the data itself (?)
The closest I have been able to get so far is:
<FUNDS>
<SYMBOL>AMRGX</SYMBOL>
<NAME>AMERICAN GROWTH D</NAME>
</FUNDS>
<FUNDS>
<SYMBOL>AHERX</SYMBOL>
<NAME>AMERICAN HERITAGE FUND</NAME>
</FUNDS>
.
.
.As you can see (hopefully) I am able to get the data I need but cannot get:
(1) the FUNDS tag(s) to be the very highest level/root.
nor (2) the SYMBOL part (tag label?) to be the actual variable stock fund.
Am I 'splaining this well enough? I don't necessarily need all the code, since I know I haven't given enough info to help with that, but my basic question is - - Is it possible to get a variable TAG based on the table DATA?
I want my SYMBOL tag to be the actual SYMBOL for the stock fund.
Confused? Not as much as I am *LOL* I am new to the use of all but XML EXPLICIT use, so any help would be appreciated - at least regarding my two formatting questions.
Yes, I have (and am still) searching around BOL for my answers, but so I have found nothing that helps me out. Meanwhile, suggestions are welcome!
Thanks!
View 6 Replies
ADVERTISEMENT
Mar 2, 2014
I am trying to create an ssis package with dynamic csv file as output. and out format contains query output.
sample file name:
Unique identifier + query output + systemdate();
The expression is looking like this.
@[User::FilePath] + @[User::FileName] + ".CSV"
-- user filepath is a variable from ssis package. File name is the output from SQL query. using script task i have assigned the values to @[User::FileName] .
When I debugged the script task the value getting properly but same variable am using for Flafile destination. but its not working.
View 3 Replies
View Related
Aug 19, 2015
I have created SSRS report which has many overlapping objects, the output in PDF format seems to good but in word format it is not giving the required output.
View 5 Replies
View Related
Dec 9, 2004
Hello everyone:
There is query output like:
1
2
3
4
How to specify it to be like"
1,2,3,4
?
Thanks
ZYT
View 1 Replies
View Related
Jun 12, 2002
Hello All,
I am new to SQL Server. I would like to know how to format output using isql on SQLServer7.0
e.g.
I want this selection
CUST_ID CUST_NAME CUST_TYPE ADDRESS
----------- ----------- ----------- -----------
1 CUST 1 CREDIT RISK ADDRESS1
1 CUST 1 CREDIT RISK ADDRESS2
2 CUST 2 GOOD ADDRESS1
2 CUST 2 GOOD ADDRESS2
2 CUST 2 GOOD ADDRESS3
3 CUST 3 BAD ADDRESS1
to display like this
CUST_ID CUST_NAME CUST_TYPE ADDRESS
----------- ----------- ----------- -----------
1 CUST 1 CREDIT RISK ADDRESS1
ADDRESS2
2 CUST 2 GOOD ADDRESS1
ADDRESS2
ADDRESS3
You are help will be much appericated.
Thanks & Regards
Nitin.
View 1 Replies
View Related
Oct 25, 2007
Using sql server
I want to create a txt file from a table i have. I have the data in the correct formats but i want to include some padding around my selected four columns.
Im not sure about the best way to go about this?
View 1 Replies
View Related
Apr 5, 2007
Hi,
I have the following problem.
I have made a parametered report where i ask a begin date (@datefrom) and an end date (@dateto).
when i enter my dates via the little calendar is see the format dd/mm/yyyy
When i do a preview of report i have a textbox with the following expression :
="Total work time from " & Parameters!DateFrom.Value & " to " & Parameters!DateTo.Value
but the output of the date format is mm/dd/yyyy.
What can i do to have the output format dd/mm/yyyy
Vincent
View 4 Replies
View Related
Aug 9, 2007
I am trying to format the result output from my query so that it looks like currency. Does anyone know how to do this?
Here is my very simple select statement:
SELECT Field_Value
FROM tbl_all_results
I was thinking some kind of cast/convert would do the trick but I can't seem to get anything to work.
Thanks for your help!
View 5 Replies
View Related
Aug 29, 2007
In my report I have used the "jump to url" for the report output but when I export this to excel I get a column with the correct data and also the url.
Is there anyway of exporting the data without the url?
I want my users to be able to view the report and click on the column the want to URL jump to but also be able to export just the raw data without the URL?
View 5 Replies
View Related
May 21, 2008
Month NoofAttendanceDays NoofPresentDays
January 25 20
Febrauary 23 21
March 26 20
April 24 21
Thanx in Advance
View 3 Replies
View Related
Jun 4, 2008
I have the following Query which gives the output in XML format.
select * from <Table_Name> For XML auto
I wanted to store this output in a .Xml file at my local machine.
I would prefer to have a proc when called generates the xml and stores it on the local m/c. Any ideas ?
Thanks,
View 3 Replies
View Related
Dec 6, 2004
I manually build my url for my reports. In the url I build, I can specify the output format I would like it to automatically use when the report opens. However, it always first opens the dialog box to either Save, Open, or Cancel. Is there anyway to bypass this and just open it in the format I have coded in the url? Thanks.
View 2 Replies
View Related
Sep 19, 2001
Hi Kids,
I've just upgraded a 6.5 database to version 7.0 and I'm having a problem with default date output formats.
Under 6.5 the output format was: Sep 2 2001 12:00PM
Under 7.0 the same field is output as: 2001-09-02 12:00:00.000
Is there a way to permanently set the default output format for dates on a database or server wide?
Thanks
Ron
View 1 Replies
View Related
Jun 8, 2004
Has anyone had experience formatting an excel file (i.e. run a macro) after it is (created &) outputted from a DTS package?
Also an easier question:
What is the best (easiest) way to create a unique filename in Excel with a datetimestamp in the file name (i.e. MyFile-20040608.xls)
Thanks!
View 3 Replies
View Related
Dec 12, 2014
I have sample data like 'J.S.xxxx','J.xxxx.'
Want to separate the . in the middle of word with single space and display results in following way.
J. S. xxxx
J. xxxx
Need the code in optimized way.
View 3 Replies
View Related
Jun 7, 2006
Hi All,Currently the query returns 2006-03-27 00:00:00, can I make it output03/27/2006, I want to truncate the time, and replace the hyphens withforward slashes. Any ideas?Thanks In Advance,~CK
View 6 Replies
View Related
Mar 14, 2007
A few details first:
The report server is remote to the development server (VS 2003).
The web application that will be calling it is ASP.NET 2.0 and developed in VS 2005.
I have a couple of questions:
a: Can I link to the report from the web application using a basic Hyperlink control rather than using a ReportViewer control?
b: How can I force which format it opens in? Say I want it to be rendered as a PDF in one instance but at an XSL document in another.
Many thanks and kindest regards,
TwoForTea
View 1 Replies
View Related
May 17, 2006
Are there any good examples creating an asychronous output. I need to be able to output the values from the input as well as adding 7 new columns to each row.
View 3 Replies
View Related
Feb 28, 2014
I have the following code and the result set is coming out as nvarchar. So, when I create a report in SSRS, it is not formatting as a date.
, CASE
WHEN isnull(cv2.Accepted,0)='True' AND cv2.Visit ='V2' AND cv2.StepNo='3' THEN 'Y'
ELSE CONVERT(varchar,[dbo].[fn_Get_WorkingDays] (co.PlannedGoLiveDt, -10))
END AS 'System Verified'
View 3 Replies
View Related
Feb 8, 2007
Hello folks,
A while back I wrote a .NET assembly with a COM wrapper to provide an interface between Report Services and legacy MS Access applications. Basically, it returns the byte arrays from the .render method (output format emf) to be written into an Access image control.
This worked flawlessly on any 8.5"x11" RS report we threw at it on the first two Report Services I tried it against. When we set up a third Report Service at another facility, the same reports were coming out with the physical dimension metrics on the emf as10"x13", so the Access version of the report is clipped significantly on the edges.
I trapped the output into a System.Drawing.Image object in the .NET assembly and put a watch on it. The two servers that work as I expected show HorizontalResolution and VerticalResolution as 96.0946, while the one that doesn't has these values as 81.2799. The PhysicalDimension property shows 21542.3672 x 27939.4316 on the working servers and 25531.25 x 33031.25 Otherwise, the properties of the images seem to be identical. The PhysicalDimension values I see are completely consistent with the size units of 0.01 mm, as the the emf documentation indicates. The resolution of 96 is consistent with the "Windows default" values of 96 dpi. The ratio of the resolutions is correct for an 85% scaling factor for the "misbehaving" Report Service.
I have not been able to find any reason for the differences between the Report Services, and I have not been able to figure out how to control it. I tried setting DpiX and DpiY as 96 in the DeviceInfo for the render call with no change in the behavior of either server.
Can anybody enlighten me on what is happening and what I need to do to get consistent behavior between the servers? Or why the DpiX and DpiY settings for the emf rendering extension don't seem to work?
Thanks,
Tim Bailey
Energy Laboratories, Inc.
View 4 Replies
View Related
Jul 20, 2005
This may be a basic question, but defining anything other than a cursoris preffered.I have, as an example, 2 tables. One with customer data (addresses,phones, etc), the other is a listing of all 50 states (a cross referencefor short state alias to long state name, i.e. FL - Florida, etc...).I want to sort the out put by state long name, and show each customer inthe state ... BUT ...the output needs to be like so:FloridaABC,Inc Address1 City, State Zip, other InfoDummy Corp Address1 City, State Zip, other Info...GeorgiaXYZ, Inc Address1 City, State Zip, other Info...etc ...This is a basic heirarchical listing. Can this be done with a singleT-SQL statement or are cursors needed?Thanks in advance."Excellence is achieved through 1% inspiration and 99% perspiration." A.Einstein*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
View 1 Replies
View Related
Jan 29, 2005
SELECT membername, outputval
case when choice = 0 then outputval else null end as outputval
from MyDatabase
group by membername, outputval
how to format outputval:
if outputval < 40000
format outputval as:
5 - 5.78 - 6.9 - 6,778 - 4,567.8 - 12,456.78 - etc.
if outputval >= 40000
format it as a scientific.
View 1 Replies
View Related
May 16, 2013
I am trying to output a number in a specific format. I am playing with CAST() and CONVERT() but have not been able to get what I need.
Current: 0.019891
Desired: 000199
It doesn't have to remain in a number format, as i will be output to a CSV in order to bulk load into another system.
View 4 Replies
View Related
Aug 19, 2015
I have a table Test123 having three column EmpID,AttribName,AttribValue.
run the below query to generate table structure and data.
Create Table Test123(EmpID int,AttribName varchar(50),AttribValue varchar(50))
insert into Test123 values(1,'Name','X')
insert into Test123 values(1,'Age',50)
insert into Test123 values(1,'Salary',1000)
insert into Test123 values(2,'Name','Y')
insert into Test123 values(2,'Age',30)
insert into Test123 values(2,'Salary',2000)
insert into Test123 values(3,'Name','Z')
insert into Test123 values(3,'Age',35)
insert into Test123 values(3,'Salary','One Hundred')
And I want output in below format.
AttributeValueType
=================
AGE | NUMERIC
NAME | ALPHABET
SALARY | ALPHANUMERIC
==================
View 6 Replies
View Related
Oct 3, 2007
I have AdventureWorks installed. I am using SQL Server 2005.
I need to import some large tab delimited text files into SQL. From the research i did I thought that using BCO would be the best solution becausr I will have to import these files and export in the same format.
I am attempting to follow the example at:
Creating a Format File
http://msdn2.microsoft.com/en-us/library/ms191516.aspx
B. Creating a non-XML format file for character data
In my command window at C: I enter:
bcp AdventureWorks.HumanResources.Department format nul -c -f Department-c.fmt -T
I was expecting to be prompted with questions about the source file and have a format file created. When i press enter nothing hallende. No errors. Nothing.
Can come one give a beginner the step by step on how to creat the format file and use it to import (and export would be nice too).
View 2 Replies
View Related
Jul 20, 2005
SQL Server 2000I need to compare 2 tables as follows:Table 1 - AccountsAcct#, Account NameTable 2 - Ledger(Among Others)Acct#,AccountNameI would like to create a view where the account number matches in both tables but the account name does not.I.e. Table 1:5000 MaintenanceTable 2:5000 Maintenance5000 Maintenance5000 Building Maintenancemy query view would display:5000 Building Maintenanceindicating there is a "Bad Record" and I would do some processing from there.FYI - I know I could prevent this easily, but I am actually comparing several databases with Table 2 data with a central Table 1 database.TIA-- Tim Morrison--------------------------------------------------------------------------------Vehicle Web Studio - The easiest way to create and maintain your vehicle related website.http://www.vehiclewebstudio.com
View 2 Replies
View Related
Aug 30, 2006
First, I can not change the data structure. I have a table called codesubsections that has an identity as the primary key. When a new codesubsection is entered the user can mark a formercodesubsection as a parent. The problem is that I need to be able to evaluate the table and identify the lowest CodeSubsectionID for a given row. so for instant when I look at row 7 it's text is 17 B p2 but because the CodeSubSectionID is not null I need to look at 6 then 5 and since 5 is null I need the text for 5,6,7 all to be 16:1 B. The only solution I have had any kind of luck with is to do a self join 3 times and coalesce the values up. See the code at the end. I am at my wits end, I had it working the other way assuming that the CodeSubSectionID was the parent of the record. This is the final piece of code on a project that is supposed to end tomorrow.
Any help is appreciated. I would normally post the procedures but I think that they are more confusing that the data explanation. This type of relationship is a first for me after 20 some years.
ID CodeSubSectionID Text
1 NULL 16:1 A
2 NULL 16:1 B
3 NULL 17 A
4 NULL 17 B p1
5 NULL 16:1 B
6 5 16:1 B
7 6 17 B p2
8 3 17 C
9 NULL 18
View 7 Replies
View Related
Oct 22, 2005
Hi all,Could someone give me an example on how to create and execute the store procedure with using output parameter?In normal, I create the store procedure without using output parameter, and I did it as follow:CREATE PROC NewEmployee (ID int(9), Name Varchar (30), hiredate DateTime, etc...)ASBEGIN //my codeENDGOWhen i executed it, I would said: Execute NewEmployee 123456789, 'peter mailler', getDate(), etc....For output parameter:CREATE PROC NewEmployee (ID int(9), Name Varchar (30), hiredate DateTime, @message Varchar(40) out)ASBEGIN insert into Employee ...... //if error encountered set @message = "Insertion failure"ENDGOExec NewEmployee 123456789, 'peter mailler', getDate(), do I need to input something for the output parameter here?Anyone could give me an example on how to handle the output parameter within the store procedure coz I am not sure how to handle it?Many thanks.
View 1 Replies
View Related
Dec 5, 2005
Hi
Being a rookie to stored procedures the following cry for help will be posted.
The stored procedure below is supposed to create a dynamic string as an output parameter
create procedure spGetFieldNameList
@TableName varchar(256),@String varchar(8000) output
As
select @String = @String + sc.name + ','
from syscolumns as sc(nolock) join sysobjects as so(nolock)
on sc.id = so.id
and so.name = @TableName
order by colid asc
Creating the stored procedure does not trigger an error.
Calling the stored procedure as: spGetFieldNameList 'OfferCondition'.
Causes the following message:
Server: Msg 201, Level 16, State 4, Procedure spGetFieldNameList, Line 0
Procedure 'spGetFieldNameList' expects parameter '@String', which was not supplied.
Calling it this way:
declare @String as varchar(8000)
set @String = ''
set @String = spGetFieldNameList 'OfferCondition'.
Causes:
Server: Msg 170, Level 15, State 1, Line 3
Line 3: Incorrect syntax near 'OfferCondition'.
Any help is highly appreciated.
Thanks
View 6 Replies
View Related
Feb 14, 2006
Hi,
I have a 2 custom components - source and destination.
I want to create an error output for each, to allow the users of my component to handle errors the way they choose.
I only found a property in IDTSOuptut90 named isErrorOut - a boolean property indicating whether this output is an error output or not.
Does anyone have additional documentation / articles / code samples regarding how to really populate the rows in the error output?
Thanks
View 1 Replies
View Related
Apr 17, 2014
I need to display the output of a table in a specific format, I have attached the sample screenshot and code for reference.
I tried with pivot but does not seems to be working.
View 2 Replies
View Related
Mar 23, 2015
I am working on a code that will convert the query output into a html query output. That is the output of the query will be along with html tags so that we can save it as a html file.
The stored procedure that i have used is downloaded from symantec website and is working fine. Below is the code of that stored procedure.
/****** Object: StoredProcedure [dbo].[sp_Table2HTML] Script Date: 12/21/2011 09:04:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_Table2HTML] (
@TABLENAME NVARCHAR(500),
@OUTPUT NVARCHAR(MAX) OUTPUT,
[Code] ....
The code works fine and i am able to get the output with html tags. The problem occurs when i insert stylesheet in the code. I tried to enforce styles using a stylesheet for the table returned in my sql code, so that it will look good. below is the stylesheet code that i inserted between <head> and </head> tags.
<style type="text/css">table.gridtable { font-family: verdana,arial,sans-serif; font-size:10px; color:#333333;border-width:1px; border-color: #666666; border-collapse: collapse; } table.gridtable td {border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #ffffff;}</style>
If I run the procedure without the style sheet code, it works fine. but when i run the procedure with style sheet code i am getting the below errors.
Msg 105, Level 15, State 1, Line 98
Unclosed quotation mark after the character string '</table></body><'.
Msg 102, Level 15, State 1, Line 98
Incorrect syntax near '</table></body><'.
[Code] .....
I checked the code and i am not able to find what is the mistake. I tried changing the quotation mark but it didn't worked.
View 6 Replies
View Related
Jul 6, 2006
sql2k sp4
Howdy all. I havent used format files inside BCP in several years and am having trouble creating one now.
declare @exec varchar(1026)
set @exec = 'bcp faa_ivr.dbo.primary_informant format -SboxNameinstanceName -c -T -f\destinationFAAIVRprimary_informant_format.txt '
exec master..xp_cmdshell @exec
output
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQLState = 08001, NativeError = 17
Error = [Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server does not exist or access denied.
SQLState = 01000, NativeError = 2
Warning = [Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen (Connect()).
NULL
(5 row(s) affected)
I've tried brackets ([])around the box/ instance name. I've tried using the FQDN. I tried the SA account instead of WINNT authentication. All ideas are appreciated.
View 4 Replies
View Related