Xslt Filters On Xml Output. Cdata-section-elements And Omit-xml-declaration Problems.

Sep 14, 2006

Hi All,



I'm using some xslt documents to transform the xml output of my Reports
but have come across two curiosities where the xslt filter seems to
behave unusually.



Firstly, I need the final saved file to have an xml declaration, which
I believe it should do by default. Even if I put
omit-xml-declaration="no" in the xsl:output tag I don't get an xml
declaration. At present we have a custom job that writes these
declarations back into the xml after SRS has saved it.



Secondly and more importantly, I need to have some of my output tags
wrapped in CDATA sections. I've tried using the cdata-section-elements
attribute, again with no luck.

my XSLT looks something like this (simplified for space)



<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" encoding="utf-8" media-type="text/xml" omit-xml-declaration="no" cdata-section-elements="description"/>

<xsl:template match="/">

<xsl:for-each select="Report/table1/Detail_Collection/Detail">

<item>

<description>


<xsl:value-of select="@Description"/>

</description>

</item>

</xsl:for-each>

</xsl:template>

</xsl:stylesheet>



The output is something like:



<item>

<description>My first description text...</description>

</item>


<item>


<description>My seconddescription text...</description>


</item>



What I want is:

<?xml version="1.0" encoding="utf-8"?>

<item>


<description><![CDATA[My first description text...]]></description>


</item>



<item>



<description><![CDATA[My secondfirst description text...]]></description>



</item>



All help gratefully appreciated.



Thanks - Andrew.

View 5 Replies


ADVERTISEMENT

Problem With CDATA Section In FOR XML EXPLICIT

Nov 1, 2006

Hi,
I am trying to create a XML out of sql 2005 database using FOR XML. I
need to create XML for tables which may contain data having
non-printable ascii characters (1-32 ascii character). I found FOR XML
AUTO failes to genrate this XML, but i can genrate XML using CDATA
section in FOR XML EXPLICIT. As following querie works fine for me.


SELECT
1 AS tag
NULL AS parent,
template_id AS [Emailqueue!1!user_id],
misc1 AS [Emailqueue!1!!cdata]
FROM Emailqueue WITH (NOLOCK)
WHERE queue_id = -2147483169
FOR XML EXPLICIT


in above query misc1 column may contain some non printable ascii
characters.


But i need to store this XML data in some sql XML variable as i need to
pass it to store procedure which expects an xml input. While doing
following i gets an error saying "illegal xml character"


DECLARE @XMLMessage XML


SET @XMLMessage = (SELECT
1 AS tag
NULL AS parent,
template_id AS [Emailqueue!1!user_id],
misc1 AS [Emailqueue!1!!cdata]
FROM Emailqueue WITH (NOLOCK)
WHERE queue_id = -2147483169
FOR XML EXPLICIT)


I am doing all this exercise for SQL service broker. For which i even
need to process same message using OPENXML on differen database server.
Again which will need well formated XML.


Let me know if something dose'nt make sense


any help is appreciated


Thanks

View 1 Replies View Related

Data Contained In A CDATA Section In XML Is Lost

Aug 1, 2006

I know that anything in a CDATA section will be ignored by an XML parser. Does that hold true for the SSIS XML Source?

I am trying to import a large quantity of movie information and all of the reviews, synopsis, etc are contained in CDATA. example:

<synopsis size="100"><![CDATA[Four vignettes feature thugs in a pool hall, a tormented ex-con, a cop and a gangster.]]></synopsis>

Sounds like a good one, no?

The record gets inserted into the database however it contains a NULL in the field for the synopsis text. I would imagine that the reason for this would fall at the feet of CDATA's nature and that SSIS is ignoring it.

Any thoughts would be appreciated. Thanks.

View 4 Replies View Related

Message Output From XSLT XML Task

Sep 11, 2006

Where does output from <xsl:message> stylesheet elements go? It's not in the Progress or Output window, and there doesn't seem to be a property that controls the destination for messages.

View 4 Replies View Related

Missing Log Output Section For SSIS Packages In The SQL Agent Job Properties

May 6, 2008



Hi All,

I have a requirement of logging the failure and the error of a job executing a SSIS package to text file.
However, when I go to job step -> Advanced, in the section "SQL Server
Integration Services Package" where that info to setup logging is, it
is blank and just says:

"There are no options for this command type"

Any ideas?

I thought that this might not be supported in Standard Edition as I am running standard edition. Then I checked on two other servers, where I have Enterprise edition with SP2. On one of the installations, I am able to give the log file, the other one still shows,

"There are no options for this command type"

What is the problem? Both of them I am using the sysadmin role account. I have proxy account created on both the SQL instances. I don't think this is the problem, but still I checked this.

Can anybody help me?

Regards,
Virendra

View 8 Replies View Related

How Can I Take This Example Flat File And Parse Out Each Section To A New Flat File? Each Section Starts With HD (header Row)

Mar 13, 2006

How can I take this example Flat file and parse out each section to a new flat file?  Each section starts with HD (header row)

http://www.webfound.net/flat_file_example.txt

e.g. an example output file based on above (cutting out the first section) would be:

http://www.webfound.net/flatfile_output.txt

Also, I'll need to grab a certain value in each header row (certain position in the 100 byte header row) to use that as part of the filename that's outputed.  I assume it would be better to insert these rows into a temp table then somehow do a search on a specific position in the row...but that's impossible?  The other route is to insert each row into a temp table separated out by fields but that is going to be too combursome because we have several formats to determine separation of fields based on the row type so I'd have to create many temp tables and many components in SSIS when all we want to do is again:

1) output each group (broken by each header row) into it's own txt file

2) use a field in  the  header row as part of the name of the output txt file (e.g. look at the first row, whcih is a header row in flat_file_example. txt.  I want to grab the text 'AR10' and use that as part of the filename that I create

Any suggestions on how to approach this whole process in SSIS...the simplest approach that will work ?

View 1 Replies View Related

Prior Omit

Apr 13, 2006

Hello, Is there a way to do a prior omit in a SELECT?

I currently have multiple selections separated by a GO, but I need to prior Omit the rows I selected prior

so I have

select * from mytabe where
Address <> ' ' and
Zip4 <> ' ' and
zip in ('12345')
Go

select * from mytabe where
Address <> ' ' and
Zip4 <> ' ' and
Purchcode in ('A','C')
Go

This continues for another 10 selections I need to constantly omit the selections made above.

Is there a way to do this in SQL?



Thanks!

View 2 Replies View Related

Omit Rows That Have NULL Value

Sep 21, 2015

It's been a while since I last posted on here, about 4 years maybe more. Anyway I'm happy to be back. I have an existing query that I needed to add two columns to. I did that but now my dilemma is to have the query NOT return NULL values in a particular column (pd.premium_amount). I tried adding WHERE pd.premium_amount IS NOT NULL and that did not do the trick. I was thinking about trying to use CASE statement but didn't really see that as being an option. Below is my code.

USE [AmLink_DW]
DECLARE @Bil_Grps TABLE (bil_grp_id int, bil_grp_sname varchar(50))
INSERT INTO @Bil_Grps (bil_grp_id, bil_grp_sname)
SELECT *
FROM (
VALUES

[Code] .....

View 9 Replies View Related

SQL XML :: How To Get CDATA With FOR XML PATH

Aug 9, 2006

How do I get a CDATA section in results when using a SELECT ... FOR XML PATH?  (SQL 2005 SP1)

View 8 Replies View Related

Using A View To Omit Data From Another Table

Mar 21, 2007

Where it's select in red I want to be able to look in another table with a listing of email domains (@express.com,@express.net,@example.org), and when the are query that I don't view them. I don't know if I need some kind of varible or just lookup in another table. I have windows 2000, and same for SQL. I am trying to write it using SQL Query Analyzer.

Thank You,

Ernie


SELECT FirstName, LastName, Street, city, State, zip, Country, Providence, TypeOfAccount, RemoteComputerName, Timestamp1, PresentEmail, NewEmail,
Password, Age, Account_Active
FROM dbo.newusers
WHERE (FirstName <> ' NULL') AND (LastName <> ' NULL') AND (PresentEmail <> ' LOOKUP in another table') AND (NewEmail <> ' NULL') AND (Password <> ' NULL') AND
(Age <> ' NULL') AND (Account_Active <> 'yes') AND (Account_Active <> 'reject') AND (Account_Active <> 'spammer')

View 7 Replies View Related

How To Omit Schema Name When Referrring To Tables?

Jan 9, 2006

Hi guys, please help.What I did is :Step1. create a Database named [Test], it's default owner is [sa]Step2. create a User in Database [Test] named [kimliuTest], which mapsto the Login [kkhadkimliu] on this Database Server, it's a windowsdomain user.Step3. create a Schema in Database [Test] named [schTest], whose SchemaOwner is User [kimliuTest]Step4. created two tables: [dbo].[t1] and [schTest].[t2]Step5. run the scriptALTER USER kimliuTest WITH DEFAULT_SCHEMA = schTestto set the default schema.Now my problem is, when I try to runselect * from schTest.t2, everything is OK, but if I runselect * from t2the error message says:Msg 208, Level 16, State 1, Line 1Invalid object name 't2'.why? I'm loggin in with my [kkhadkimliu] windows domain id , ActiveMonitor also shows that. but the command does not work?Yeah, it's a good habit to write the full name of the Table with Schemaname as prefix, however, we did our development in SQL 2000 and tryingto upgrade to SQL2005, so trying to avoid scanning codes and insertingin thousand of places.How could we omit the Schema name when referrring to Tables? Thanks.ps. I posted in another topic days ago, but nobody is replying, when Itried to bring it forward by replying myself, it failed. please help me, thanks!

View 3 Replies View Related

SQL XML :: How To Use Multi Sub Parents Using CDATA Tag

Oct 8, 2015

We have stored some special characters in our database and when we extract as XML Auto, Elements it through error illegal characters during import. I am looking and saw CDATA with Explicit option but don't know how to use it with multi tags like:

<1>
<12>
<23>
<34>
</34>
</23>
</12>
</1>

View 12 Replies View Related

Dealing With CDATA Returned By Sql Server

Jan 18, 2004

I am using SQL Server to return a XML result set. I then perform a XSLT transformation on the returned result set to fill in HTML form text and select elements. The data returned includes the & character. This character correctly transforms, however I believe that the & is negatively impacting my form post (one of the form elements disappears from the posted data). How can I get around this?

View 1 Replies View Related

Sp_xml_preparedocument CDATA Reserved Characters

Nov 29, 2007



I have tried both in sql server 2000 and sql server 2005 the following code:

DECLARE @DOC VARCHAR(100)
DECLARE @HDOC INT
SET @Doc='<datos><texto><![CDATA[línea átona]]></texto></datos>'
EXEC sp_xml_preparedocument @HDOC OUTPUT, @DOC
SELECT * FROM OPENXML(@HDOC,'datos',2) WITH (texto nvarchar(50))

I always get an error 6603 in SQL2000 and 6602+8179 in SQL2005, wich means it can't parse the 'í' and 'á' characters, though they are in a CDATA.
I have tried with <,>,@ characters and it works fine.

I have also tried using '&aacute;' and '&iacute;' without CDATA but I get the same message:

DECLARE @DOC VARCHAR(100)
DECLARE @HDOC INT
SET @Doc='<datos><texto><l&iacute;nea &aacute;tona></texto></datos>'
EXEC sp_xml_preparedocument @HDOC OUTPUT, @DOC
SELECT * FROM OPENXML(@HDOC,'datos',2) WITH (texto nvarchar(50))

View 5 Replies View Related

T-SQL (SS2K8) :: Agent Job Report Omit Previously Sent Data

Nov 27, 2014

I have this report i setup as an agent job in SSMS; It's setup to run every 7 minutes and it only sends the report if data is present. I'd like to add the ability to omit any rows that were sent in the previous report.

This is what the script looks like:

if exists (select o.ord_billto, o.ord_refnum , o.ord_hdrnumber, o.mov_number, o.ord_status, o.ord_cmdvalue, o.ord_startdate
from orderheader o
where ord_billto in ('A','B','C','D')
and DATEDIFF(minute , o.ord_datetaken, GETDATE())<=7

[Code] ....

Also, why I can't seem to use IF ( Select [...]) > 0? When i try using that instead of IF EXISTS i get this error: "Msg 116, Level 16, State 1, Line 7
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS."

View 5 Replies View Related

Does DB-Restore On A Different Machine Omit User/login Information ?

Jul 23, 2005

Dear group,I am a DB-Administrator for a Company that creates and maintains asoftware solution based on SQL-Server and Crystal-Reports.The Crystal-Reports part uses the following method to present data.First a specific user (database authentification) is created with afixed password. Then Crystal Reports uses thisuser/password-information to login to the database and present or printthe data.I recently received a database from a customer of ours and i restoredit on my machine. It worked perfectly except that the Crystal Reportspart did not function at all (showing only blank reports).After dropping the specific user and creating the fixed password thething worked.So my question: does restoring a SQL-Server database on a differentmachine alter or eliminate login and user information ?Any reply will be highly appreciated.Greetings from ViennaUli

View 2 Replies View Related

XML Source To Data Conversion To OLE DB Destination - Loss Of CDATA

Apr 9, 2007

I'm trying to build a DTSX package that FTP's an XML file to the local file system and then imports it into an existing table.

My "Data Flow" for the package starts with an XML Source component and then goes to Data Conversion component and then to an OLE DB Destination component.

It all executes with out error and seems to work fine, but when I look at the data in the table after I've run the package it seems to have inserted the appropriate number of rows from the XML file but all of the column values are NULL.

All of the data in the XML file is surrounded by <![CDATA[ ]]> and I discovered that if I remove the CDATA wrapper by hand then it inserts the data properly. The only problem is that I'm not in a position to have the data provider remove the CDATA tags and some of the data in the XML file needs the CDATA wrapper or else it will not validate.

Anyone know of anything I can do to get the CDATA to import properly?

View 15 Replies View Related

XML, XSLT And SQL Server

Jun 14, 1999

I want to delete and recreate the master Database Device for purpose of shrinking the size of the device .
I dont want to loose the Master db.

I thought of transfering the Master db to a different device,
Delete and recreate the master device and then tranfer back the master db .
and this is all done through the MS SQL enterprise Manager (SQL 6.5 )
Is this the safest eay to proceed with this task?

Any thoughts are greatly appreciated.

Thank you
Guss Hasb

View 1 Replies View Related

XML Task &&amp; XSLT

Feb 23, 2007

Can I use the XML task in SSIS to create an excel document? If so which operation type is best to do it with, XSLT?

I'm trying create excel files dynamically with nothing more than a SQL statement that I'm passing as a variable which generates XML. I would then like to take that variable and combine it with a template and create an excel document. Any help would be appreciated. I do not want to use the data flow because it requires all transformations ahead of time.



Thanks,

Phil

View 3 Replies View Related

Displaying Xml With Xslt In RS

Sep 10, 2007



Hi,

I've got an xml and an xslt - I want to get that into reporting services. Right now I have a link to the xml file in a 'report', which will open it correctly and format with the xslt. I'd like it to display without going to an external link.

I know how to use an xml datasource, but I need the xslt applied, since it has some nice formatting in it - so i don't think that will work.

I'm trying to report on the results of a scripted ms baseline security analyzer of several servers - the style sheet lets you drill down and has links to the base reports.

Thanks for your help.

View 4 Replies View Related

How To Change Xml With Xslt In Ssis

Mar 3, 2008

Hi,

I've got a problem with my ssis package.
I have a webservice, which from i am downloading xml file which looks like this:









Code Snippet

<?xml version="1.0" encoding="utf-16"?>
<DataSet>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="lukas_id_nagrody" type="xs:string" minOccurs="0" />
<xs:element name="ilosc" type="xs:int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet>
<Table diffgr:id="Table1" msdata:rowOrder="0">
<lukas_id_nagrody>10</lukas_id_nagrody>
<ilosc>4</ilosc>
</Table>
<Table diffgr:id="Table2" msdata:rowOrder="1">
<lukas_id_nagrody>12</lukas_id_nagrody>
<ilosc>10</ilosc>
</Table>
<Table diffgr:id="Table3" msdata:rowOrder="2">
<lukas_id_nagrody>21</lukas_id_nagrody>
<ilosc>32</ilosc>
</Table>
<Table diffgr:id="Table4" msdata:rowOrder="3">
<lukas_id_nagrody>32</lukas_id_nagrody>
<ilosc>13</ilosc>
</Table>
<Table diffgr:id="Table5" msdata:rowOrder="4">
<lukas_id_nagrody>33</lukas_id_nagrody>
<ilosc>15</ilosc>
</Table>
<Table diffgr:id="Table6" msdata:rowOrder="5">
<lukas_id_nagrody>34</lukas_id_nagrody>
<ilosc>2</ilosc>
</Table>
</NewDataSet>
</diffgr:diffgram>
</DataSet>

And i want it to looks like this:






Code Snippet

<?xml version="1.0" encoding="utf-16"?>
<DataSet>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="DataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="lukas_id_nagrody" type="xs:string" minOccurs="0" />
<xs:element name="ilosc" type="xs:int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<Table id="Table1" rowOrder="0">
<lukas_id_nagrody>J07Z0</lukas_id_nagrody>
<ilosc>1</ilosc>
</Table>
<Table id="Table2" rowOrder="1">
<lukas_id_nagrody>J08Z0</lukas_id_nagrody>
<ilosc>1</ilosc>
</Table>
<Table id="Table3" rowOrder="2">
<lukas_id_nagrody>J09Z0</lukas_id_nagrody>
<ilosc>1</ilosc>
</Table>
</DataSet>

Can You help me?

Thanks in advance

ps. sorry for my english

View 4 Replies View Related

XSLT Transformation In XML Task

Sep 10, 2007

Hi,

I've a xml file and I want to substitute some of the values from database in this xml using XSLT transformation making use of XML task. How can this be achieved?

Thanks

View 5 Replies View Related

Variable Declaration

Mar 29, 2004

hi,

i am new to sql server...

i have used @ symbol for declaring local variables in stored procedure....
The symbol @@ is there....where to use and what is the purpose of using that symbol...

could anyone tell...

thanks

View 1 Replies View Related

Generate RDL Using XSDObjectGen XSD.EXE XMLTextWriter Or XSLT...

Mar 14, 2006

I'm writing some code to generate RDL based on a set of existing tables that define reports. (Headings, columns etc.)

The options I'm exploring so far for doing this are as follows:

Use XMLTextWriter class
Use XMLDocument class
Use XMLSerialiser to serialse a set of classes made with XSD.EXE and
Use XMLSerialiser to serialse a set of classes made with XSDObjectGen
Use XSLT to convert MyReportDefinitionDataset.GetXML into RDL

Has anybody else out there seen other code that does anything like this or in general has any suggestions to help me narrow these options down?

Note:

I am hoping to allow users supplying RDL their own files as templates enabling them to define things like report header and footer etc.
My code will take the Table element from the template RDL and replace it with my generated XML (Headings and columns etc.)

Any suggestions/help/existing sample code appreciated.

Thanks,

Mike G

View 4 Replies View Related

XSLT Transform Dropping Spaces, CR's

Jun 15, 2006

I have an XSLT transform that works perfectly using the msxsl.exe utility.

When the same XSL file is run through an SSIS XML transform, the character spacing and carriage returns embedded in the XSL templates are mostly (but not completely) dropped.

Any comments on why SSIS is behaving differently than msxsl.exe? What to do?

Thanks in advance,

Richard

View 4 Replies View Related

XML Task: How To Pass Arguments To XSLT

Aug 10, 2006

In the XML Task if you set the OperationType to XSLT, how do you pass arguments to the Transform like you would in .Net by using the XsltArgumentList class? Thanks.

View 3 Replies View Related

Using Variables In A Cursor Declaration

Aug 31, 2005

Hello All,I am trying to use a variable(@varStr ) in a cursor declaration. But I am unable to use it. something like:declare @intID as intset @intID  = 1DECLARE curDetailRecords CURSOR FOR (select fnameFrom Customers where id = @intID)Can we not use a variable in a cursor declaration.?ThanksImran

View 1 Replies View Related

Cursor Declaration Blues

Dec 7, 1999

Hi!

While working for a client on a SQL Server 6.5 SP5a, I got the following error when running the code below in first SQL Enterprise Manager 6.5 and then SQL Query Analyzer 7.0:

IF @Departures = 1
DECLARE TableCursor CURSOR
FOR SELECT AcType,
BackPax = CASE BackPax
WHEN NULL THEN 0 ELSE BackPax END,
BestPax = CASE BestPax
WHEN NULL THEN 0 ELSE BestPax END,
DepTime,
FlightNumber,
ArrStn
FROM #TimeCall
ORDER BY DepTime, FlightNumber
ELSE
DECLARE TableCursor CURSOR
FOR SELECT AcType,
BackPax = CASE BackPax WHEN NULL THEN 0 ELSE BackPax END,
BestPax = CASE BestPax WHEN NULL THEN 0 ELSE BestPax END,
ArrTime,
FlightNumber,
DepStn
FROM #TimeCall
ORDER BY ArrTime, FlightNumber

And the error I get when the query is run for the first time after switching tool:

Server: Msg 202, Level 11, State 2, Procedure CreateFile, Line 178
Internal error -- Unable to open table at query execution time.
Server: Msg 202, Level 11, State 1, Procedure CreateFile, Line 188
Internal error -- Unable to open table at query execution time.

If I run the query again in one of the tools, it works. It also works if I use WITH RECOMPILE in the stored proc header.

If I use the code below, it also works, and without RECOMPILE:

DECLARE @SqlStr varchar( 255 )

IF @Departures = 1
SELECT @SqlStr = 'DECLARE TableCursor CURSOR ' +
'FOR SELECT AcType, ' +
'BackPax = CASE BackPax WHEN NULL THEN 0 ELSE BackPax END, ' +
'BestPax = CASE BestPax WHEN NULL THEN 0 ELSE BestPax END, ' +
'DepTime, FlightNumber, ArrStn ' +
'FROM #TimeCall ORDER BY DepTime, FlightNumber'
ELSE
SELECT @SqlStr = 'DECLARE TableCursor CURSOR ' +
'FOR SELECT AcType, ' +
'BackPax = CASE BackPax WHEN NULL THEN 0 ELSE BackPax END, ' +
'BestPax = CASE BestPax WHEN NULL THEN 0 ELSE BestPax END, ' +
'ArrTime, FlightNumber, DepStn ' +
'FROM #TimeCall ORDER BY ArrTime, FlightNumber'
EXECUTE( @SqlStr )

Trying to get around the problem with the following code did not do any good:

DECLARE TableCursor CURSOR FOR
SELECT AcType,
BackPax = CASE BackPax WHEN NULL THEN 0 ELSE BackPax END,
BestPax = CASE BestPax WHEN NULL THEN 0 ELSE BestPax END,
CurTime = CASE @Departures
WHEN 1 THEN DepTime
ELSE ArrTime END,
FlightNumber,
OtherStation = CASE @Departures
WHEN 1 THEN ArrStn
ELSE DepStn END
FROM #TimeCall
ORDER BY CurTime, FlightNumber

Server: Msg 202, Level 11, State 2, Procedure CreateFile, Line 176
Internal error -- Unable to open table at query execution time.

Anyone have some good ideas on why this happens?

Brgds

Jonas Hilmersson

View 1 Replies View Related

Declaration Of Record Variable

Oct 10, 2006

Can someone say how to declare a record like variable in MSSQL-2000 Like:
mr_rec record of variables a int, b char(20), c datetime? I could not find any examples on BOL. I want to use this in a stored procedure create script.

Thanks, Vinnie

View 1 Replies View Related

Declaration Expected Error

Oct 11, 2007

Hi,

I am trying to convert an active x script in a script task. Below is a snippet of code. The underlined AsOfDate has a blue squiggly line under it and if I hover over it, it says "Declaration Expected."


Public Class ScriptMain



Dim AsOfDate As String

AsOfDate = Dts.Variables("MyDate").Value
...

Can someone please tell me what I'm missing? I thought maybe I'm missing an import statement, but I have:

Imports Microsoft.SqlServer.Dts.Runtime

Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper

I have used similar syntax in script components and it works fine.

Thanks

View 6 Replies View Related

Strip DTD Out; Help With Some XSLT Inside Of SSIS XML Task

Sep 4, 2007

I'm reading over this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1884062&SiteID=1

and I'm kinda lost as to what to do to strip out the dtd from an XML file I am downloading. I do NOT know XSLT and for that reason, I can't follow his logic.

My SSIS package downloads my XML file just fine, now I need to do a strip of the DTD line in my XML Task.

The person who provided the solution in the above post said to do this...





Code Snippet
Operation Type: XSLT
Source Type: Variable
Source: Variable's name containing the xml text
Save Operation Result: True
DestinationType: Variable
OverwriteDestination: True
Destination: Variable's name which is to contain the original xml minus the DTD.
SecondOperandType: Variable







That stuff I understood. I'll replace variables with my files because they are stored that way, but from what I can tell, that's not my problem.

The stuff he says below this comment is going over my head like a ton of bricks. I can't figure out how to do it.

This is the kind of line of my XML that I want to strip out.

https://www.myaddy.com/pbdr.dtd"[]>

and then he said this...





Code Snippet
Since XSL doesn't know about DTDs, telling it to copy everything strips out DTDs. Then use the Variable specified in the Xml task's SecondOperand as the Source data for the xml source.


Code Snippet

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">

<xsl:copy-of select="." />

</< FONT>xsl:template>

</< FONT>xsl:stylesheet>

A note on how to paste a multi-line xml document into a Integration Services String variable:


Integration Services String variables textboxes are not multi-line, in the Windows sense of a line (CR+LF),

So, in order to paste multi-line text (which xml docs almost always are), save a temporary copy with a unix line ending.

That is, create an xml file in visual studio, and paste your sample original xml in there. Go to File/Advanced Save options, and save the xml with the the settings of Encoding: Unicode (utf-8 without signature) - CodePage 65001, and most importantly, set the Line endings dropdown to "Unix (LF)".

After selecting "OK", copy and paste the text from Visual Studio's xml file editor into the IS variable, and you'll note all the xml data appears.





So can anyone walk me through a dummies version of what he is suggesting to do?

Thanks,
Keith

View 1 Replies View Related

Problem With Extraction Of A Report In Xml Format Using XSLT

Nov 1, 2007

Hi guys,


I have a simple report created with rs2005. I want to get the output exported (using the export options of rs2005) in a specific xml format, so I am using xslt transformation to get it proper.

My problem is that, when I'm doing this using my own machine (SQL Server 2005 32bit installed) everything works OK. BUT when I want to try it on a server that we are supposed to use it gives me a real bad error. On the server, if I have the report without using xslt, it gets exported OK but not in the correct format. I have tested the report on a 32 and on a 64 bit server, I have used either SP1 and SP2 but still can't get through. The error message appearring while I try to export in xml is "Server Error in '/Reports' Application. The XSLT path is invalid. It refers to an external resource, uses invalid syntax, or the XSLT was not found in the catalog."


Has anyone seen something like this before ?


Your help would be much appreciated.

Thanx in advance

View 5 Replies View Related

Dynamic Variable Used In Decimal Declaration

Jun 18, 2007

I'm wondering if there's a way to pass a variable to assigning a decimal datatype;

declare @intPrecision int

set @intPrecision = 3

declare @decVariable decimal(38, @intPrecision)

I've basically been given the task by my mentor to create a script to round a decimal to a given number of decimal places.

ie; 1234.56789; 2 dp => 1234.57 and not 1234.57000

Any advice would be great.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved