Fun with static XQuery evaluation – 4 – answers and wrapup

Here’s the answers to the question from Fun With static XQuery evaluation – 2 — start with a schema collection CREATE XML SCHEMA COLLECTION ages AS ‘<xs:schema xmlns:xs=”” targetNamespace=”urn:ages” xmlns:tns=”urn:ages”> <xs:element name=”age” type=”xs:int”/> </xs:schema> ‘ GO DECLARE @x xml(ages) SET @x = ‘<age>12</age>’ — fails ??! SELECT @x.query(‘string(/age)’) GO This fails because there can be […]

Fun with static XQuery evaluation – 3

After the last two entries, you might be thinking "I guess I can never use text() as a node test with typed XML again". Not so. The error message reads: 'text()' is not supported on simple typed or '' elements. So what's left? Mixed content, for one thing. Mixed content consists of a mixture of […]

Fun with static XQuery evaluation – 2

Reference back to the previous entry. Now that we know the rules, let's try them out: — snip — Data(),text() and string() accessors XQuery has a function fn:data() to extract scalar, typed values from nodes, a node test text() to return text nodes, and the function fn:string() that returns the string value of a node. […]

Fun with static XQuery evaluation – 1

There's been lots of puzzled faces lately when I try to explain doing XQuery against strongly typed XML (XML typed by a SCHEMA COLLECTION) vs untyped XML. The largest FAQ is why when I have this document: <person>   <name>bob</name>   <age>51</age> </person> using the value function (after assignment to @person) @person.value('/person/age', 'int') returns my […]

Password policies on object passwords

A new feature of SQL Server 2005 that has been fairly well publicized is the ability, on Windows 2003 operating systems, to enforce password stregth, expiration, and lockout policies on SQL Server logins, as the operating system enforces them on Windows logins. The way that this works is that SQL Server calls NetValidatePasswordPolicy, a Win32 […]

Service Broker object names are case sensitive

One of my students last week noticed that using a Service Broker object name (like a CONTRACT, SERVICE, and MESSAGE TYPE name) with the wrong case caused an error message. That's because Service Broker object names are case sensitive by deisgn. Because these identifiers can go over the wire, and you can't predict the collation […]

XQuery and the useful XML index

Haven't been blogging as much recently, as I've been teaching and travelling quite a bit. Last week though, I received an interesting query on XQuery query plans (that's more uses of the word query in one sentence than I've seen before). We were looking at SQL query plans when XQuery is involved. I'd remembered that: […]

IRowsetFastLoad, the reprise

I had an interesting flashback today. Someone wrote with a reference to a mailing list posting I'd written in 2000, about IRowsetFastLoad. They wanted code, because nowadays attachments to public postings have become a thing of the past. Looked in my OLE DB code, from back when I was teaching "Essential OLE DB", and … […]

How do I see all the tables again?

I've been lying pretty low lately, doing research on some topics in a slightly different space (but at least obliquely SQL Server 2005 related). Came across a list of interesting student comments today, and I was back trying out (picking at?) one of my favorite spare-time topics to answer a question about. SQL Server 2005 […]