Tag Info

New answers tagged

3

Your query is a bit off from what I end up using, however I actually parse out a bit of information and do not just return the XML. The specific parts of your query that don't look right is with outside FROM you have AS tab ( event_data ) and then you are referencing that as event_data.value in your top SELECT. I would change that around to just have AS ...


2

According to http://www.red-gate.com/community/books/accidental-dba [Troubleshooting SQL Server: A Guide for the Accidental DBA] this looks to be by design. Changes to Extended Events in SQL Server Denali At the time of the final edits of this chapter, SQL Server Denali CTP3 was released, with changes associated to how the Extended Events ...


2

The declaration of singleton in the path expression of the index enforces that you can not add multiple <Number> elements but the XQuery compiler does not take that into consideration when interpreting the expression in the value() function. You have to specify [1] to make SQL Server happy. Using typed XML with a schema does not help with that either. ...


2

Add the N prefix to the INSERT statement to preserve the XML as Unicode, eg insert into #test (Document) values (N'<FormDocument xmlns="http://mynamespace.org/Schemas"> <Fields> <Field Id="a" Value="qwerty" /> <Field Id="ą" Value="123" /> </Fields> </FormDocument>')


5

Another method would be to use COLLATE DATABASE_DEFAULT vs specifying the collation explicitly. DECLARE @sql NVARCHAR(MAX) DECLARE @ParamDefinition NVARCHAR(MAX) DECLARE @log NVARCHAR(MAX) ,@vCrlf CHAR(2); SELECT @log = '' ,@vCrlf = CHAR(13)+CHAR(10); SELECT @sql = ' --========================================== -- ...


3

You'll need to put a COLLATE hint in your join clause. Basically, choose one of the two collations, i.e. Latin1_General_CI_AS and place it after the column name that uses the other collation. SELECT @SQL = ' --========================================== -- creating the users --========================================== select db = db_name(), ...



Top 50 recent answers are included