Viewing 15 posts - 6,541 through 6,555 (of 8,761 total)
As I mentioned before, often the XML must be interrogated to determine the placement of the inserted node. This sample checks both the XML to be modified and the XML...
November 24, 2014 at 3:29 am
The XML modify/insert has 4 positioning directives, as first,as last, after and before, changing from as last to after for the correct positioning, note the slight difference in the syntax.
Often...
November 23, 2014 at 3:07 pm
Quick'n simple example
😎
USE tempdb;
GO
SET NOCOUNT ON;
DECLARE @TXML XML = '<Attribute>
<A1>6529</A1>
<A2>6529</A2>
</Attribute>';
DECLARE @NNODE VARCHAR(100) = 'A3';
DECLARE @NVAL VARCHAR(100) = 'New value';
DECLARE @Nt ...
November 23, 2014 at 3:25 am
Quick solution of the "first coffee in the morning" kind, probably not the most efficient but it works
😎
USE tempdb;
GO
SET NOCOUNT ON;
IF OBJECT_ID('dbo.database_tags') IS NOT NULL DROP TABLE dbo.database_tags;
create table...
November 22, 2014 at 1:51 am
KoldCoffee (11/20/2014)
November 21, 2014 at 11:56 pm
Quick thought, the character combination is double windows new-line, 0x0D000A000D000A00 in Unicode or 0x0D0A0D0A in ASCII, construct a variable with this value and use charindex to search for it.
😎
Charindex and...
November 21, 2014 at 11:40 pm
Quick thought, IIF is kind of an oddity in this list as it brings nothing new but a Access SQL compatibility
😎
November 21, 2014 at 1:54 am
N_Muller (11/20/2014)
November 21, 2014 at 12:40 am
...
FROM
Table1 AS a
CROSS APPLY data.nodes('.../Node1') AS T1(F) -- part 1
LEFT JOIN Table1 AS b
CROSS APPLY data.nodes('.../Node2') AS T2(F) -- part 2
ON b.ID = a.ID
Quick thought, this doesn't look right...
November 20, 2014 at 10:28 pm
peacesells (11/20/2014)
Thanks Eririkur. This certainly gives me a good direction. What if there were multiple secures within a SecurEvent?
Multiple "Secure/SecureType" elements will multiply the outer/parent "SecureEvent" element, as this is...
November 20, 2014 at 9:57 pm
Koen Verbeeck (11/20/2014)
This means people have to vote for me (or other people, but preferable me):
http://www.mssqltips.com/MSSQLTipsAuthorVoting.asp
Note that you...
November 20, 2014 at 1:03 pm
N_Muller (11/20/2014)
November 20, 2014 at 8:58 am
Quick thought, if this type of queries are frequent, consider adding a geography column to the tables.
😎
Here is a far more efficient way of producing the same results
USE tempdb;
GO
SET NOCOUNT...
November 19, 2014 at 10:55 pm
jasona.work (11/19/2014)
Not even the end of November, and already we've got here in Detroit, Michigan, about 1/2"...
November 19, 2014 at 12:51 pm
Viewing 15 posts - 6,541 through 6,555 (of 8,761 total)