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 'á' and 'í' without CDATA but I get the same message:
DECLARE @DOC VARCHAR(100)
DECLARE @HDOC INT
SET @Doc='<datos><texto><línea átona></texto></datos>'
EXEC sp_xml_preparedocument @HDOC OUTPUT, @DOC
SELECT * FROM OPENXML(@HDOC,'datos',2) WITH (texto nvarchar(50))
We are thinking about using this sproc because one of our .NET app's is basically handling an array of data. The .NET guys want to give me 1 input parameter (i.e. XML) and then I would use the sproc to parse it and store the base data in columns.
Anyone witth experience with this or any comments would be appreciated
I have been trying to handle XML DataSets and read them into tables inthe SQL Server 2000. Every place I read about sp_xml_preparedocument itseems to me as if it is an in-built stored procedure the comes with theSQL Server installation. Am I right, or is it something that needs to bewritten for specific purposes/??Please comment.Thank you.*** Sent via Developersdex http://www.developersdex.com ***
Hi all,We are using a VB component to create and save an XML document on ourlocal LAN.We want to load this straight into a DB Table using a query based onOPENXML. Trouble is, the sp_xml_preparedocument command always throws anerror.Here is some code:[color=blue][color=green][color=darkred]>>>> CODE >>>>[/color][/color][/color]DECLARE @idoc intDECLARE @doc varchar(1000)EXEC sp_xml_preparedocument @idoc OUTPUT, @doc<<<< END OF CODE <<<<where @doc is the filename of our file on the LAN to be opened, and@idoc is the handle to be created.the error is:XML parsing error: Invalid at the top level of the document.Here is some of the XML Document saved on the LAN that should be openedby sp_xml_preparedocument and prepared.<?xml version="1.0" encoding="UTF-8" ?><xdata created_by="OSA" created_at="Thu Nov 13 11:33:33 EST 2003"><rows row_count="1000"><row><COL1>714761905</COL1><COL2>714761905</COL2><COL3>714761905</COL3></row></xdata>Any advice or tips whould be very helpful...thanksPhil*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
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:
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?
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.
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.
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?
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)
We have a table with a column called 'text' Yes, text is a reserved keyword for data type. I can select it 'SELECT text FROM thistable' but when I try to use it in the order clause, 'SELECT text FROM thistable ORDER BY text', I get this error:
'The text, ntext, and image data types cannot be used in an ORDER BY clause'
I know, you're not supposed to used reserved keywords but the person who initially created this didn't know. We would prefer not to change the column name as this would require tons of changes in the code & COM object.
I migrated a SQL7 database to a SQL2000 server by restoring from a backup file. Everything worked fine until we restarted the SQL Service a few days later and suddenly a table named Function caused me much grief
It seems Function is a reserved word in 2000 - but not in SQL 7.
I am guessing the restore fooled the system into thinking it was a SQL7 database until the restart? Anyone have any ideas why else it would have worked just fine for 5 days, then die on a restart of SQL service (not even a reboot!)
I've got a sproc that we are migrating from SS2K that uses the reserved keyword 'Pivot'. Best way to replace it. I think it is renameable until the select from TempDB (which is mysterious as I can't see a table in tempDB by that name!!) as below...
Hi, I have got a problem. When I try to access my database table Users, I get the following error:
SELECT permission denied on object 'Users', database 'Users', owner 'dbo'.
So I tried to grand this select command in MS Web Data Administration, but it doesnt work. When I try to grand db_datareader role to dbo, I get the following error
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot use the reserved user or role name 'db_datareader'.
Does someone have an idea where could be a problem?
when i write a query the world lights up with blue, I think I saw someone using [ ] around the word but I no longer remember if this is the way to handle reserve words that have been use as columns names
I'm trying to recreate a MS-SQL database in MySQL. One particular table has a column names "Precision", a reserved word in MySQL. I woudl really prefer to keep this name if possible as it will be referenced in all sorts of places. I've tried single and double quotes, that didn't work.
Is it possible to use reserveds word as column names? How?
Dear Friends,I'm running a SQL 2005 database. Lately (in the last 4 months) my database size has grown exponentially and now totals 2.5 gig (it used to be about 100mb). When I run sp_spaceused i get the following info: Reserved Space 2522MB Data 450MB Indexes 215MB Unused 1856MB <!--[if !supportLineBreakNewLine]--> The unused space is reserved by my two largest tables, one being 542mb (which is a log I create and the size seems fine for the amount of data) reserving 1033mb and the other being 121mb (which is another log and also seems fine) reserving most of the rest.
I have tried running DBCC SHRINKFILE and DBCC CLEANTABLE commands on a backup copy of the database and cannot seem to free the unused space.
I have also tried copying the database in an attempt to reduce the unused reserved space and have tried creating a new database and importing the tables with no luck
Any help would be greatly appreciated, noting that I'm honestly not that technical and would probably need step by step instructions, but if you only have time to point me in the right direction that would also be of great help!
We are encountering an issue of using OLE DB destination with the field name of the table is a reserved word in the database.
The database is DB2 V8 (mainframe). "partition" is one of the reserved word in V8 (It is not in the previous version and the whole thing worked fine).
It errors out when it reaches to the OLE DB destination task to do the insert. It complaints about using the reserved word, "partition". We could use an "OLE DB command" (instead of a to do an OLE DB Destination) with the insert SQL statement explicitly by putting double quote around the field name, partition in the insert statement. It works this way. But We wondered if there is any work around of using a reserved word in OLE DB destination in that case?
I am attempting to define a Transactional Publication with Updateable Subscriptions.
One of the articles in the definition has a column called "insertDate" The attempt fails with"A .NET Framework error occurred during execution of user-defined routine or aggregate "sp_MSmakeconflicttable_ sqlclr" System.Data.SqlClient.SqlException: Column names in each table must be unique. Column name insertdata in table 'conflict_ <Publication Name>_<TableName>' is specified more than onceDoes sp_MSmakeconflicttable_sqlclr attempt to create a derived table with this additional column.
Must I rename my column.Are there any other names I should watch out for (other than the standard reserved keywords).
In my application I must store over 16000 character in a sql table field . When I split into more than 1 field it gives "unclosed quotation mark" message. How can I store over 16000 characters to sql table field (only one field) with language specific characters?
Please can anyone help me - I am trying to establish whether there are any reserved symbols in SQL passwords
eg % £ " $ ( / < * etc
The SQL BOL has a list of reserved words but I cannot find a list of reserved symbols.
We have a problem where by for example if the main part of the password is "test" and my user wants to add a punctuation mark into this we get "You are attempting to use an invalid character message"
Specifically
"test$" is accepted "$test" is not accepted None of "te+st" "+test" "test+" are accepted.
Has anyone else come across this and found a list of the logic that produces these results so I can point my users in the right direction?
I have a table which has 6 text columns (tblA).. I no longer require 1 of those text columns and want to reclaim the space that it is currently taking up..
Is the only way to BCP out all the data (except the 1 column i no longer require) drop the column and BCP the data back into the table?
I haven't found anything that shows that "sample" is a reserved word in SQL 2000. However when I enter it in Query Analyzer, the color changes to blue, as it is a transact-sql word. However, I'm still able to create a table called sample or name the column.
Does anybody know why query analyzer recognizes it as a transact-sql/reserverd word??
In on of the server tempdb is not releasing the reserved space after completion of data loads,as of now 99% of free space available in data file,we tried to shrink the datafile ,and space has not been released.
Hello all, I have a database that supports two different applications. For arguments sake I'll call them "intelligent app" and "clueless app"
The client that provided me the schema for the clueless app used reserved words as field names. The words used are: value, state, and time
I explained to the client that modifying them could prevent current/future issues.
The client is an "oracle" db (and in my mind should know better but .....) and responded back to me with the following:
BEGIN QUOTE They are not currently reserved and there is no guarantee they will ever be reserved. In fact, the SQL server line eliminates as many words from the reserved list as they add with new releases. There are other words on the possible future reserved keyword list that I do not wish to avoid either unless forced to some day, like depth, size, class, zone, level and others. END QUOTE
Now for the assistance request, where can I find the documented ramifications of using reserved words? I want to have my documentation (and my ducks lined up) when this clients portion of the app fails.
Hi everybody, I would like to know if there is any property in sql2000 database to separate lowercase characters from uppercase characters. I mean not to take the values €˜child€™ and €˜Child€™ as to be the same. We are transferring our ingres database into sqlserver. In ingres we have these values but we consider them as different values. Can we have it in sqlserver too?