Showing posts with label schema. Show all posts
Showing posts with label schema. Show all posts

Tuesday, March 20, 2012

[SS2K5] : Dynamically construct a FROM statement with current SCHEMA

Hi,

I've got a DB with some schemas.

There's same tables under these schemas as for example :

MySchema1.MyTable1

MySchema2.MyTable1

I wrote CRUD stored procedures for these tables.

I'd like to dynamically create the FROM statement inside the stored procedures by getting the schema name from the current context.

Kind of :

FROM SCHEMA_NAME().MyTable1

So I'll have one generic stored procedure for MyTable1.

This stored proc will be under the DB level and will not have to be replicate under all the schemas.

Is it possible ?

Thanks for any help.

BERTRANDR

Sure, sp_executesql is such a utility to run dynamic sql. Basically you construct a SQL string(NVARCHAR) with parameters first, then use sp_executesql to execute it. Look at Book Online for details.|||Why do you want to use a generic SP? Using dynamic SQL has lot of issues - complexity, performance (it depends on the case), security risks, permissions management, debugging pain, ownership chaining issues in your case etc. You should create a SP in each schema that handles the modifications for each table. This is much more robust, simpler to manage, debug, code etc.|||

Well my point is that I don t want to duplicate objects that have the same purposes and do exactly the same things for the same table but under differents schemas.

I thought it was the best thing to do .

But maybe am I wrong ..

Monday, March 19, 2012

[SS2K5] : Dynamically construct a FROM statement with current SCHEMA

Hi,

I've got a DB with some schemas.

There's same tables under these schemas as for example :

MySchema1.MyTable1

MySchema2.MyTable1

I wrote CRUD stored procedures for these tables.

I'd like to dynamically create the FROM statement inside the stored procedures by getting the schema name from the current context.

Kind of :

FROM SCHEMA_NAME().MyTable1

So I'll have one generic stored procedure for MyTable1.

This stored proc will be under the DB level and will not have to be replicate under all the schemas.

Is it possible ?

Thanks for any help.

BERTRANDR

Sure, sp_executesql is such a utility to run dynamic sql. Basically you construct a SQL string(NVARCHAR) with parameters first, then use sp_executesql to execute it. Look at Book Online for details.|||Why do you want to use a generic SP? Using dynamic SQL has lot of issues - complexity, performance (it depends on the case), security risks, permissions management, debugging pain, ownership chaining issues in your case etc. You should create a SP in each schema that handles the modifications for each table. This is much more robust, simpler to manage, debug, code etc.|||

Well my point is that I don t want to duplicate objects that have the same purposes and do exactly the same things for the same table but under differents schemas.

I thought it was the best thing to do .

But maybe am I wrong ..

Sunday, March 11, 2012

[SQL 2005] XQuery xs:NOTATION

I thought I read in BOL that SQL 2K5's XQuery implementation does not
support the XML Schema xs:NOTATION datatype; but I'm having a hard time
finding that page again. I was able to locate a page in BOL
(http://msdn2.microsoft.com/en-us/library/ms191231.aspx) that indicates type
casting to/from xs:NOTATION is not supported, but need to know is
xs:NOTATION actually supported at all? Any references to this information
(one way or the other) is appreciated.
Thanks!Hi Mike
On the page you posted
http://msdn2.microsoft.com/en-us/library/ms191231.aspx :
"xs:NOTATION and the fully ordered subtypes of duration,
xdt:yearMonthDuration and xdt:dayTimeDuration, are not supported. As a
result, casting to or from these types is not supported."
On http://msdn2.microsoft.com/pt-br/library/ms189547.aspx
"Constructors are supported for base and derived atomic XSD types. However,
the subtypes of xs:duration, which includes xdt:yearMonthDuration and
xdt:dayTimeDuration, and xs:QName, xs:NMTOKEN, and xs:NOTATION are not
supported. User-defined atomic types that are available in the associated
schema collections are also available, provided they are directly or
indirectly derived from the following types."
John
"Mike C#" wrote:
> I thought I read in BOL that SQL 2K5's XQuery implementation does not
> support the XML Schema xs:NOTATION datatype; but I'm having a hard time
> finding that page again. I was able to locate a page in BOL
> (http://msdn2.microsoft.com/en-us/library/ms191231.aspx) that indicates type
> casting to/from xs:NOTATION is not supported, but need to know is
> xs:NOTATION actually supported at all? Any references to this information
> (one way or the other) is appreciated.
> Thanks!
>
>|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:A04FBA1C-8FB5-4461-83D3-201B858C672F@.microsoft.com...
> Hi Mike
> On the page you posted
> http://msdn2.microsoft.com/en-us/library/ms191231.aspx :
> "xs:NOTATION and the fully ordered subtypes of duration,
> xdt:yearMonthDuration and xdt:dayTimeDuration, are not supported. As a
> result, casting to or from these types is not supported."
Thanks, that seems to indicate xs:NOTATION is not supported at all. The
fact that xs:NOTATION is included in the chart at the top of that page seems
to contradict that wording though...
> On http://msdn2.microsoft.com/pt-br/library/ms189547.aspx
> "Constructors are supported for base and derived atomic XSD types.
> However,
> the subtypes of xs:duration, which includes xdt:yearMonthDuration and
> xdt:dayTimeDuration, and xs:QName, xs:NMTOKEN, and xs:NOTATION are not
> supported. User-defined atomic types that are available in the associated
> schema collections are also available, provided they are directly or
> indirectly derived from the following types."
Here's where the confusion comes in - xs:NOTATION is either supported (as a
virtual base type, as indicated on the chart on the first page and alluded
to in the quote from the second page), or it's not supported at all (as
indicated by the wording on the first page).
I assume the statement from the second page doesn't really indicate that
xs:NOTATION itself is not supported, but rather that an xs:NOTATION
constructor is not supported. That's based on the fact that xs:QName *is*
supported (though no constructor), and it's listed in the same sentence
where it says "...are not supported."
Mostly I think I'm just a victim of poor wording. xs:NOTATION constructor
and xs:NOTATION casting are clearly not supported, but is xs:NOTATION itself
(even as a virtual base type) supported or not?|||Hi Mike
I think overall if you add everything up then you have to say there is no
support at all. There is no constructor so you can't create anything of that
type, you can not cast to or from so even if you had something of that type
you can't do much with it.
Have you tried using it?
John
"Mike C#" wrote:
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:A04FBA1C-8FB5-4461-83D3-201B858C672F@.microsoft.com...
> > Hi Mike
> >
> > On the page you posted
> > http://msdn2.microsoft.com/en-us/library/ms191231.aspx :
> >
> > "xs:NOTATION and the fully ordered subtypes of duration,
> > xdt:yearMonthDuration and xdt:dayTimeDuration, are not supported. As a
> > result, casting to or from these types is not supported."
> Thanks, that seems to indicate xs:NOTATION is not supported at all. The
> fact that xs:NOTATION is included in the chart at the top of that page seems
> to contradict that wording though...
> > On http://msdn2.microsoft.com/pt-br/library/ms189547.aspx
> >
> > "Constructors are supported for base and derived atomic XSD types.
> > However,
> > the subtypes of xs:duration, which includes xdt:yearMonthDuration and
> > xdt:dayTimeDuration, and xs:QName, xs:NMTOKEN, and xs:NOTATION are not
> > supported. User-defined atomic types that are available in the associated
> > schema collections are also available, provided they are directly or
> > indirectly derived from the following types."
> Here's where the confusion comes in - xs:NOTATION is either supported (as a
> virtual base type, as indicated on the chart on the first page and alluded
> to in the quote from the second page), or it's not supported at all (as
> indicated by the wording on the first page).
> I assume the statement from the second page doesn't really indicate that
> xs:NOTATION itself is not supported, but rather that an xs:NOTATION
> constructor is not supported. That's based on the fact that xs:QName *is*
> supported (though no constructor), and it's listed in the same sentence
> where it says "...are not supported."
> Mostly I think I'm just a victim of poor wording. xs:NOTATION constructor
> and xs:NOTATION casting are clearly not supported, but is xs:NOTATION itself
> (even as a virtual base type) supported or not?
>
>|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:AC29C43A-7507-48AF-A419-3015A4654597@.microsoft.com...
> Hi Mike
> I think overall if you add everything up then you have to say there is no
> support at all. There is no constructor so you can't create anything of
> that
> type, you can not cast to or from so even if you had something of that
> type
> you can't do much with it.
> Have you tried using it?
Consider xs:QName: ( no constructor for xs:QName + no casting to or from an
xs:QName from any other type ) != no support at all. xs:QName is definitely
supported.
I haven't tried using xs:NOTATION directly, since the chart indicates it's a
"virtual base type". Presumably other types can be created from it. I
figured the good folks from Microsoft who visit these newsgroups might be
able to shed some light on how it might be used at all if it is supported as
a "virtual base type", or explain the apparent discrepancy in the
documentation if it's not supported at all.
Thanks.|||"Mike C#" <xyz@.xyz.com> wrote in message
news:uzrl9$HHHHA.3872@.TK2MSFTNGP06.phx.gbl...
>> Have you tried using it?
> Consider xs:QName: ( no constructor for xs:QName + no casting to or from
> an xs:QName from any other type ) != no support at all. xs:QName is
> definitely supported.
> I haven't tried using xs:NOTATION directly, since the chart indicates it's
> a "virtual base type". Presumably other types can be created from it. I
> figured the good folks from Microsoft who visit these newsgroups might be
> able to shed some light on how it might be used at all if it is supported
> as a "virtual base type", or explain the apparent discrepancy in the
> documentation if it's not supported at all.
>
I just ran a simple test for xs:NOTATION, and the result was SQL giving me
the error message "NOTATION not supported". So it looks like it doesn't
support xs:NOTATION at all. Someone at MS should fix that chart on the
XQuery datatypes casting page.
Thanks for the help!|||Hi Mike
The chart shows casting between QNs so it would indicate some support! It
may be interesting to see what happens if you try to construct one!!
You could try sending feedback on this using the contact us option at the
bottom of the page.
John
"Mike C#" wrote:
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:AC29C43A-7507-48AF-A419-3015A4654597@.microsoft.com...
> > Hi Mike
> >
> > I think overall if you add everything up then you have to say there is no
> > support at all. There is no constructor so you can't create anything of
> > that
> > type, you can not cast to or from so even if you had something of that
> > type
> > you can't do much with it.
> >
> > Have you tried using it?
> Consider xs:QName: ( no constructor for xs:QName + no casting to or from an
> xs:QName from any other type ) != no support at all. xs:QName is definitely
> supported.
> I haven't tried using xs:NOTATION directly, since the chart indicates it's a
> "virtual base type". Presumably other types can be created from it. I
> figured the good folks from Microsoft who visit these newsgroups might be
> able to shed some light on how it might be used at all if it is supported as
> a "virtual base type", or explain the apparent discrepancy in the
> documentation if it's not supported at all.
> Thanks.
>
>|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:7C916F7A-ED18-46E3-86F4-4E5B2E93D1A5@.microsoft.com...
> Hi Mike
> The chart shows casting between QNs so it would indicate some support! It
> may be interesting to see what happens if you try to construct one!!
> You could try sending feedback on this using the contact us option at the
> bottom of the page.
>
Hi John
QN's don't have a constructor function per se, but there is an F&O function
to create a QN. The QN casting is strictly QN to QN. The xs:NOTATION
doesn't even work with the "instance of" operator (which was my test), and
it comes back with the error message stating explicitly that no support for
xs:NOTATION exists, so that's what I'm going with :)
Thanks|||The first thing to test is, if the type is supported in XML Schema
collections... and it is not.
CREATE XML SCHEMA COLLECTION SCX AS
N'<xsd:schema targetNamespace="urn:example/customer"
xmlns:e="urn:example/customer"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xsd:element name="buys" type="xsd:NOTATION"/>
</xsd:schema>'
returns
Msg 9337, Level 16, State 1, Line 1
The XML Schema type 'NOTATION' is not supported.
Since schema does not support the type, XQuery does not either.
If this type is important for your scenario, please file a bug report under
http://connect.microsoft.com/sqlserver
Thanks
Michael
"Mike C#" <xyz@.xyz.com> wrote in message
news:%23RoXrrTHHHA.1816@.TK2MSFTNGP06.phx.gbl...
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:7C916F7A-ED18-46E3-86F4-4E5B2E93D1A5@.microsoft.com...
>> Hi Mike
>> The chart shows casting between QNs so it would indicate some support! It
>> may be interesting to see what happens if you try to construct one!!
>> You could try sending feedback on this using the contact us option at the
>> bottom of the page.
> Hi John
> QN's don't have a constructor function per se, but there is an F&O
> function to create a QN. The QN casting is strictly QN to QN. The
> xs:NOTATION doesn't even work with the "instance of" operator (which was
> my test), and it comes back with the error message stating explicitly that
> no support for xs:NOTATION exists, so that's what I'm going with :)
> Thanks
>|||I can work around that limitation for now. It would be nice if they could
refresh the documentation on it to get rid of xs:NOTATION from the chart and
state a little more clearly that it's not supported. Right now the
statement that it's not supported is combined with a couple of other items
that are supported in various fashions, which leads to having to do tests
like this to determine if it actually is supported or not.
Thanks.
"Michael Rys [MSFT]" <mrys@.online.microsoft.com> wrote in message
news:eFSlFP8HHHA.1248@.TK2MSFTNGP03.phx.gbl...
> The first thing to test is, if the type is supported in XML Schema
> collections... and it is not.
> CREATE XML SCHEMA COLLECTION SCX AS
> N'<xsd:schema targetNamespace="urn:example/customer"
> xmlns:e="urn:example/customer"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
> <xsd:element name="buys" type="xsd:NOTATION"/>
> </xsd:schema>'
> returns
> Msg 9337, Level 16, State 1, Line 1
> The XML Schema type 'NOTATION' is not supported.
> Since schema does not support the type, XQuery does not either.
> If this type is important for your scenario, please file a bug report
> under http://connect.microsoft.com/sqlserver
> Thanks
> Michael
> "Mike C#" <xyz@.xyz.com> wrote in message
> news:%23RoXrrTHHHA.1816@.TK2MSFTNGP06.phx.gbl...
>> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
>> news:7C916F7A-ED18-46E3-86F4-4E5B2E93D1A5@.microsoft.com...
>> Hi Mike
>> The chart shows casting between QNs so it would indicate some support!
>> It
>> may be interesting to see what happens if you try to construct one!!
>> You could try sending feedback on this using the contact us option at
>> the
>> bottom of the page.
>>
>> Hi John
>> QN's don't have a constructor function per se, but there is an F&O
>> function to create a QN. The QN casting is strictly QN to QN. The
>> xs:NOTATION doesn't even work with the "instance of" operator (which was
>> my test), and it comes back with the error message stating explicitly
>> that no support for xs:NOTATION exists, so that's what I'm going with :)
>> Thanks
>|||Hi Mike
If you find the limitation for <xsd:limitation>,pls let me know at
rohiniraj@.rediffmail.com
Im also struggling in that only.
Also if you find the limitation for
XML schema components can have an ID attribute, but SQL Server does not
store these value
pls tell me.
Thanks in advance.|||These limitations should all be documented in Books Online.
I know that we document that we do not save the ID attribute...
If any of the existing limitations are a problem, please file a bug
report/feature request at
http://connect.microsoft.com/sqlserver.
Thanks
Mike
<rohiniraj@.rediffmail.com> wrote in message
news:1166538986.101987.264990@.73g2000cwn.googlegroups.com...
> Hi Mike
> If you find the limitation for <xsd:limitation>,pls let me know at
> rohiniraj@.rediffmail.com
> Im also struggling in that only.
> Also if you find the limitation for
> XML schema components can have an ID attribute, but SQL Server does not
> store these value
> pls tell me.
> Thanks in advance.
>

[SQL 2005] XQuery xs:NOTATION

I thought I read in BOL that SQL 2K5's XQuery implementation does not
support the XML Schema xs:NOTATION datatype; but I'm having a hard time
finding that page again. I was able to locate a page in BOL
(http://msdn2.microsoft.com/en-us/library/ms191231.aspx) that indicates type
casting to/from xs:NOTATION is not supported, but need to know is
xs:NOTATION actually supported at all? Any references to this information
(one way or the other) is appreciated.
Thanks!Hi Mike
On the page you posted
http://msdn2.microsoft.com/en-us/library/ms191231.aspx :
"xs:NOTATION and the fully ordered subtypes of duration,
xdt:yearMonthDuration and xdt:dayTimeDuration, are not supported. As a
result, casting to or from these types is not supported."
On http://msdn2.microsoft.com/pt-br/library/ms189547.aspx
"Constructors are supported for base and derived atomic XSD types. However,
the subtypes of xs:duration, which includes xdt:yearMonthDuration and
xdt:dayTimeDuration, and xs:QName, xs:NMTOKEN, and xs:NOTATION are not
supported. User-defined atomic types that are available in the associated
schema collections are also available, provided they are directly or
indirectly derived from the following types."
John
"Mike C#" wrote:

> I thought I read in BOL that SQL 2K5's XQuery implementation does not
> support the XML Schema xs:NOTATION datatype; but I'm having a hard time
> finding that page again. I was able to locate a page in BOL
> (http://msdn2.microsoft.com/en-us/library/ms191231.aspx) that indicates ty
pe
> casting to/from xs:NOTATION is not supported, but need to know is
> xs:NOTATION actually supported at all? Any references to this information
> (one way or the other) is appreciated.
> Thanks!
>
>|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:A04FBA1C-8FB5-4461-83D3-201B858C672F@.microsoft.com...
> Hi Mike
> On the page you posted
> http://msdn2.microsoft.com/en-us/library/ms191231.aspx :
> "xs:NOTATION and the fully ordered subtypes of duration,
> xdt:yearMonthDuration and xdt:dayTimeDuration, are not supported. As a
> result, casting to or from these types is not supported."
Thanks, that seems to indicate xs:NOTATION is not supported at all. The
fact that xs:NOTATION is included in the chart at the top of that page seems
to contradict that wording though...

> On http://msdn2.microsoft.com/pt-br/library/ms189547.aspx
> "Constructors are supported for base and derived atomic XSD types.
> However,
> the subtypes of xs:duration, which includes xdt:yearMonthDuration and
> xdt:dayTimeDuration, and xs:QName, xs:NMTOKEN, and xs:NOTATION are not
> supported. User-defined atomic types that are available in the associated
> schema collections are also available, provided they are directly or
> indirectly derived from the following types."
Here's where the confusion comes in - xs:NOTATION is either supported (as a
virtual base type, as indicated on the chart on the first page and alluded
to in the quote from the second page), or it's not supported at all (as
indicated by the wording on the first page).
I assume the statement from the second page doesn't really indicate that
xs:NOTATION itself is not supported, but rather that an xs:NOTATION
constructor is not supported. That's based on the fact that xs:QName *is*
supported (though no constructor), and it's listed in the same sentence
where it says "...are not supported."
Mostly I think I'm just a victim of poor wording. xs:NOTATION constructor
and xs:NOTATION casting are clearly not supported, but is xs:NOTATION itself
(even as a virtual base type) supported or not?|||Hi Mike
I think overall if you add everything up then you have to say there is no
support at all. There is no constructor so you can't create anything of that
type, you can not cast to or from so even if you had something of that type
you can't do much with it.
Have you tried using it?
John
"Mike C#" wrote:

> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:A04FBA1C-8FB5-4461-83D3-201B858C672F@.microsoft.com...
> Thanks, that seems to indicate xs:NOTATION is not supported at all. The
> fact that xs:NOTATION is included in the chart at the top of that page see
ms
> to contradict that wording though...
>
> Here's where the confusion comes in - xs:NOTATION is either supported (as
a
> virtual base type, as indicated on the chart on the first page and alluded
> to in the quote from the second page), or it's not supported at all (as
> indicated by the wording on the first page).
> I assume the statement from the second page doesn't really indicate that
> xs:NOTATION itself is not supported, but rather that an xs:NOTATION
> constructor is not supported. That's based on the fact that xs:QName *is*
> supported (though no constructor), and it's listed in the same sentence
> where it says "...are not supported."
> Mostly I think I'm just a victim of poor wording. xs:NOTATION constructor
> and xs:NOTATION casting are clearly not supported, but is xs:NOTATION itse
lf
> (even as a virtual base type) supported or not?
>
>|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:AC29C43A-7507-48AF-A419-3015A4654597@.microsoft.com...
> Hi Mike
> I think overall if you add everything up then you have to say there is no
> support at all. There is no constructor so you can't create anything of
> that
> type, you can not cast to or from so even if you had something of that
> type
> you can't do much with it.
> Have you tried using it?
Consider xs:QName: ( no constructor for xs:QName + no casting to or from an
xs:QName from any other type ) != no support at all. xs:QName is definitely
supported.
I haven't tried using xs:NOTATION directly, since the chart indicates it's a
"virtual base type". Presumably other types can be created from it. I
figured the good folks from Microsoft who visit these newsgroups might be
able to shed some light on how it might be used at all if it is supported as
a "virtual base type", or explain the apparent discrepancy in the
documentation if it's not supported at all.
Thanks.|||"Mike C#" <xyz@.xyz.com> wrote in message
news:uzrl9$HHHHA.3872@.TK2MSFTNGP06.phx.gbl...
> Consider xs:QName: ( no constructor for xs:QName + no casting to or from
> an xs:QName from any other type ) != no support at all. xs:QName is
> definitely supported.
> I haven't tried using xs:NOTATION directly, since the chart indicates it's
> a "virtual base type". Presumably other types can be created from it. I
> figured the good folks from Microsoft who visit these newsgroups might be
> able to shed some light on how it might be used at all if it is supported
> as a "virtual base type", or explain the apparent discrepancy in the
> documentation if it's not supported at all.
>
I just ran a simple test for xs:NOTATION, and the result was SQL giving me
the error message "NOTATION not supported". So it looks like it doesn't
support xs:NOTATION at all. Someone at MS should fix that chart on the
XQuery datatypes casting page.
Thanks for the help!|||Hi Mike
The chart shows casting between QNs so it would indicate some support! It
may be interesting to see what happens if you try to construct one!!
You could try sending feedback on this using the contact us option at the
bottom of the page.
John
"Mike C#" wrote:

> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:AC29C43A-7507-48AF-A419-3015A4654597@.microsoft.com...
> Consider xs:QName: ( no constructor for xs:QName + no casting to or from
an
> xs:QName from any other type ) != no support at all. xs:QName is definite
ly
> supported.
> I haven't tried using xs:NOTATION directly, since the chart indicates it's
a
> "virtual base type". Presumably other types can be created from it. I
> figured the good folks from Microsoft who visit these newsgroups might be
> able to shed some light on how it might be used at all if it is supported
as
> a "virtual base type", or explain the apparent discrepancy in the
> documentation if it's not supported at all.
> Thanks.
>
>|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:7C916F7A-ED18-46E3-86F4-4E5B2E93D1A5@.microsoft.com...
> Hi Mike
> The chart shows casting between QNs so it would indicate some support! It
> may be interesting to see what happens if you try to construct one!!
> You could try sending feedback on this using the contact us option at the
> bottom of the page.
>
Hi John
QN's don't have a constructor function per se, but there is an F&O function
to create a QN. The QN casting is strictly QN to QN. The xs:NOTATION
doesn't even work with the "instance of" operator (which was my test), and
it comes back with the error message stating explicitly that no support for
xs:NOTATION exists, so that's what I'm going with
Thanks|||The first thing to test is, if the type is supported in XML Schema
collections... and it is not.
CREATE XML SCHEMA COLLECTION SCX AS
N'<xsd:schema targetNamespace="urn:example/customer"
xmlns:e="urn:example/customer"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xsd:element name="buys" type="xsd:NOTATION"/>
</xsd:schema>'
returns
Msg 9337, Level 16, State 1, Line 1
The XML Schema type 'NOTATION' is not supported.
Since schema does not support the type, XQuery does not either.
If this type is important for your scenario, please file a bug report under
http://connect.microsoft.com/sqlserver
Thanks
Michael
"Mike C#" <xyz@.xyz.com> wrote in message
news:%23RoXrrTHHHA.1816@.TK2MSFTNGP06.phx.gbl...
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:7C916F7A-ED18-46E3-86F4-4E5B2E93D1A5@.microsoft.com...
> Hi John
> QN's don't have a constructor function per se, but there is an F&O
> function to create a QN. The QN casting is strictly QN to QN. The
> xs:NOTATION doesn't even work with the "instance of" operator (which was
> my test), and it comes back with the error message stating explicitly that
> no support for xs:NOTATION exists, so that's what I'm going with
> Thanks
>|||Hi Mike
If you find the limitation for <xsd:limitation>,pls let me know at
rohiniraj@.rediffmail.com
Im also struggling in that only.
Also if you find the limitation for
XML schema components can have an ID attribute, but SQL Server does not
store these value
pls tell me.
Thanks in advance.

[SQL 2005] XQuery xs:NOTATION

I thought I read in BOL that SQL 2K5's XQuery implementation does not
support the XML Schema xs:NOTATION datatype; but I'm having a hard time
finding that page again. I was able to locate a page in BOL
(http://msdn2.microsoft.com/en-us/library/ms191231.aspx) that indicates type
casting to/from xs:NOTATION is not supported, but need to know is
xs:NOTATION actually supported at all? Any references to this information
(one way or the other) is appreciated.
Thanks!Hi Mike
On the page you posted
http://msdn2.microsoft.com/en-us/library/ms191231.aspx :
"xs:NOTATION and the fully ordered subtypes of duration,
xdt:yearMonthDuration and xdt:dayTimeDuration, are not supported. As a
result, casting to or from these types is not supported."
On http://msdn2.microsoft.com/pt-br/library/ms189547.aspx
"Constructors are supported for base and derived atomic XSD types. However,
the subtypes of xs:duration, which includes xdt:yearMonthDuration and
xdt:dayTimeDuration, and xs:QName, xs:NMTOKEN, and xs:NOTATION are not
supported. User-defined atomic types that are available in the associated
schema collections are also available, provided they are directly or
indirectly derived from the following types."
John
"Mike C#" wrote:

> I thought I read in BOL that SQL 2K5's XQuery implementation does not
> support the XML Schema xs:NOTATION datatype; but I'm having a hard time
> finding that page again. I was able to locate a page in BOL
> (http://msdn2.microsoft.com/en-us/library/ms191231.aspx) that indicates ty
pe
> casting to/from xs:NOTATION is not supported, but need to know is
> xs:NOTATION actually supported at all? Any references to this information
> (one way or the other) is appreciated.
> Thanks!
>
>|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:A04FBA1C-8FB5-4461-83D3-201B858C672F@.microsoft.com...
> Hi Mike
> On the page you posted
> http://msdn2.microsoft.com/en-us/library/ms191231.aspx :
> "xs:NOTATION and the fully ordered subtypes of duration,
> xdt:yearMonthDuration and xdt:dayTimeDuration, are not supported. As a
> result, casting to or from these types is not supported."
Thanks, that seems to indicate xs:NOTATION is not supported at all. The
fact that xs:NOTATION is included in the chart at the top of that page seems
to contradict that wording though...

> On http://msdn2.microsoft.com/pt-br/library/ms189547.aspx
> "Constructors are supported for base and derived atomic XSD types.
> However,
> the subtypes of xs:duration, which includes xdt:yearMonthDuration and
> xdt:dayTimeDuration, and xs:QName, xs:NMTOKEN, and xs:NOTATION are not
> supported. User-defined atomic types that are available in the associated
> schema collections are also available, provided they are directly or
> indirectly derived from the following types."
Here's where the confusion comes in - xs:NOTATION is either supported (as a
virtual base type, as indicated on the chart on the first page and alluded
to in the quote from the second page), or it's not supported at all (as
indicated by the wording on the first page).
I assume the statement from the second page doesn't really indicate that
xs:NOTATION itself is not supported, but rather that an xs:NOTATION
constructor is not supported. That's based on the fact that xs:QName *is*
supported (though no constructor), and it's listed in the same sentence
where it says "...are not supported."
Mostly I think I'm just a victim of poor wording. xs:NOTATION constructor
and xs:NOTATION casting are clearly not supported, but is xs:NOTATION itself
(even as a virtual base type) supported or not?|||Hi Mike
I think overall if you add everything up then you have to say there is no
support at all. There is no constructor so you can't create anything of that
type, you can not cast to or from so even if you had something of that type
you can't do much with it.
Have you tried using it?
John
"Mike C#" wrote:

> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:A04FBA1C-8FB5-4461-83D3-201B858C672F@.microsoft.com...
> Thanks, that seems to indicate xs:NOTATION is not supported at all. The
> fact that xs:NOTATION is included in the chart at the top of that page see
ms
> to contradict that wording though...
>
> Here's where the confusion comes in - xs:NOTATION is either supported (as
a
> virtual base type, as indicated on the chart on the first page and alluded
> to in the quote from the second page), or it's not supported at all (as
> indicated by the wording on the first page).
> I assume the statement from the second page doesn't really indicate that
> xs:NOTATION itself is not supported, but rather that an xs:NOTATION
> constructor is not supported. That's based on the fact that xs:QName *is*
> supported (though no constructor), and it's listed in the same sentence
> where it says "...are not supported."
> Mostly I think I'm just a victim of poor wording. xs:NOTATION constructor
> and xs:NOTATION casting are clearly not supported, but is xs:NOTATION itse
lf
> (even as a virtual base type) supported or not?
>
>|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:AC29C43A-7507-48AF-A419-3015A4654597@.microsoft.com...
> Hi Mike
> I think overall if you add everything up then you have to say there is no
> support at all. There is no constructor so you can't create anything of
> that
> type, you can not cast to or from so even if you had something of that
> type
> you can't do much with it.
> Have you tried using it?
Consider xs:QName: ( no constructor for xs:QName + no casting to or from an
xs:QName from any other type ) != no support at all. xs:QName is definitely
supported.
I haven't tried using xs:NOTATION directly, since the chart indicates it's a
"virtual base type". Presumably other types can be created from it. I
figured the good folks from Microsoft who visit these newsgroups might be
able to shed some light on how it might be used at all if it is supported as
a "virtual base type", or explain the apparent discrepancy in the
documentation if it's not supported at all.
Thanks.|||"Mike C#" <xyz@.xyz.com> wrote in message
news:uzrl9$HHHHA.3872@.TK2MSFTNGP06.phx.gbl...
> Consider xs:QName: ( no constructor for xs:QName + no casting to or from
> an xs:QName from any other type ) != no support at all. xs:QName is
> definitely supported.
> I haven't tried using xs:NOTATION directly, since the chart indicates it's
> a "virtual base type". Presumably other types can be created from it. I
> figured the good folks from Microsoft who visit these newsgroups might be
> able to shed some light on how it might be used at all if it is supported
> as a "virtual base type", or explain the apparent discrepancy in the
> documentation if it's not supported at all.
>
I just ran a simple test for xs:NOTATION, and the result was SQL giving me
the error message "NOTATION not supported". So it looks like it doesn't
support xs:NOTATION at all. Someone at MS should fix that chart on the
XQuery datatypes casting page.
Thanks for the help!|||Hi Mike
The chart shows casting between QNs so it would indicate some support! It
may be interesting to see what happens if you try to construct one!!
You could try sending feedback on this using the contact us option at the
bottom of the page.
John
"Mike C#" wrote:

> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:AC29C43A-7507-48AF-A419-3015A4654597@.microsoft.com...
> Consider xs:QName: ( no constructor for xs:QName + no casting to or from
an
> xs:QName from any other type ) != no support at all. xs:QName is definite
ly
> supported.
> I haven't tried using xs:NOTATION directly, since the chart indicates it's
a
> "virtual base type". Presumably other types can be created from it. I
> figured the good folks from Microsoft who visit these newsgroups might be
> able to shed some light on how it might be used at all if it is supported
as
> a "virtual base type", or explain the apparent discrepancy in the
> documentation if it's not supported at all.
> Thanks.
>
>|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:7C916F7A-ED18-46E3-86F4-4E5B2E93D1A5@.microsoft.com...
> Hi Mike
> The chart shows casting between QNs so it would indicate some support! It
> may be interesting to see what happens if you try to construct one!!
> You could try sending feedback on this using the contact us option at the
> bottom of the page.
>
Hi John
QN's don't have a constructor function per se, but there is an F&O function
to create a QN. The QN casting is strictly QN to QN. The xs:NOTATION
doesn't even work with the "instance of" operator (which was my test), and
it comes back with the error message stating explicitly that no support for
xs:NOTATION exists, so that's what I'm going with :)
Thanks|||The first thing to test is, if the type is supported in XML Schema
collections... and it is not.
CREATE XML SCHEMA COLLECTION SCX AS
N'<xsd:schema targetNamespace="urn:example/customer"
xmlns:e="urn:example/customer"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xsd:element name="buys" type="xsd:NOTATION"/>
</xsd:schema>'
returns
Msg 9337, Level 16, State 1, Line 1
The XML Schema type 'NOTATION' is not supported.
Since schema does not support the type, XQuery does not either.
If this type is important for your scenario, please file a bug report under
http://connect.microsoft.com/sqlserver
Thanks
Michael
"Mike C#" <xyz@.xyz.com> wrote in message
news:%23RoXrrTHHHA.1816@.TK2MSFTNGP06.phx.gbl...
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:7C916F7A-ED18-46E3-86F4-4E5B2E93D1A5@.microsoft.com...
> Hi John
> QN's don't have a constructor function per se, but there is an F&O
> function to create a QN. The QN casting is strictly QN to QN. The
> xs:NOTATION doesn't even work with the "instance of" operator (which was
> my test), and it comes back with the error message stating explicitly that
> no support for xs:NOTATION exists, so that's what I'm going with :)
> Thanks
>|||I can work around that limitation for now. It would be nice if they could
refresh the documentation on it to get rid of xs:NOTATION from the chart and
state a little more clearly that it's not supported. Right now the
statement that it's not supported is combined with a couple of other items
that are supported in various fashions, which leads to having to do tests
like this to determine if it actually is supported or not.
Thanks.
"Michael Rys [MSFT]" <mrys@.online.microsoft.com> wrote in message
news:eFSlFP8HHHA.1248@.TK2MSFTNGP03.phx.gbl...
> The first thing to test is, if the type is supported in XML Schema
> collections... and it is not.
> CREATE XML SCHEMA COLLECTION SCX AS
> N'<xsd:schema targetNamespace="urn:example/customer"
> xmlns:e="urn:example/customer"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
> <xsd:element name="buys" type="xsd:NOTATION"/>
> </xsd:schema>'
> returns
> Msg 9337, Level 16, State 1, Line 1
> The XML Schema type 'NOTATION' is not supported.
> Since schema does not support the type, XQuery does not either.
> If this type is important for your scenario, please file a bug report
> under http://connect.microsoft.com/sqlserver
> Thanks
> Michael
> "Mike C#" <xyz@.xyz.com> wrote in message
> news:%23RoXrrTHHHA.1816@.TK2MSFTNGP06.phx.gbl...
>

[SQL 2005] XQuery xs:NOTATION

I thought I read in BOL that SQL 2K5's XQuery implementation does not
support the XML Schema xs:NOTATION datatype; but I'm having a hard time
finding that page again. I was able to locate a page in BOL
(http://msdn2.microsoft.com/en-us/library/ms191231.aspx) that indicates type
casting to/from xs:NOTATION is not supported, but need to know is
xs:NOTATION actually supported at all? Any references to this information
(one way or the other) is appreciated.
Thanks!
Hi Mike
On the page you posted
http://msdn2.microsoft.com/en-us/library/ms191231.aspx :
"xs:NOTATION and the fully ordered subtypes of duration,
xdt:yearMonthDuration and xdt:dayTimeDuration, are not supported. As a
result, casting to or from these types is not supported."
On http://msdn2.microsoft.com/pt-br/library/ms189547.aspx
"Constructors are supported for base and derived atomic XSD types. However,
the subtypes of xs:duration, which includes xdt:yearMonthDuration and
xdt:dayTimeDuration, and xs:QName, xs:NMTOKEN, and xs:NOTATION are not
supported. User-defined atomic types that are available in the associated
schema collections are also available, provided they are directly or
indirectly derived from the following types."
John
"Mike C#" wrote:

> I thought I read in BOL that SQL 2K5's XQuery implementation does not
> support the XML Schema xs:NOTATION datatype; but I'm having a hard time
> finding that page again. I was able to locate a page in BOL
> (http://msdn2.microsoft.com/en-us/library/ms191231.aspx) that indicates type
> casting to/from xs:NOTATION is not supported, but need to know is
> xs:NOTATION actually supported at all? Any references to this information
> (one way or the other) is appreciated.
> Thanks!
>
>
|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:A04FBA1C-8FB5-4461-83D3-201B858C672F@.microsoft.com...
> Hi Mike
> On the page you posted
> http://msdn2.microsoft.com/en-us/library/ms191231.aspx :
> "xs:NOTATION and the fully ordered subtypes of duration,
> xdt:yearMonthDuration and xdt:dayTimeDuration, are not supported. As a
> result, casting to or from these types is not supported."
Thanks, that seems to indicate xs:NOTATION is not supported at all. The
fact that xs:NOTATION is included in the chart at the top of that page seems
to contradict that wording though...

> On http://msdn2.microsoft.com/pt-br/library/ms189547.aspx
> "Constructors are supported for base and derived atomic XSD types.
> However,
> the subtypes of xs:duration, which includes xdt:yearMonthDuration and
> xdt:dayTimeDuration, and xs:QName, xs:NMTOKEN, and xs:NOTATION are not
> supported. User-defined atomic types that are available in the associated
> schema collections are also available, provided they are directly or
> indirectly derived from the following types."
Here's where the confusion comes in - xs:NOTATION is either supported (as a
virtual base type, as indicated on the chart on the first page and alluded
to in the quote from the second page), or it's not supported at all (as
indicated by the wording on the first page).
I assume the statement from the second page doesn't really indicate that
xs:NOTATION itself is not supported, but rather that an xs:NOTATION
constructor is not supported. That's based on the fact that xs:QName *is*
supported (though no constructor), and it's listed in the same sentence
where it says "...are not supported."
Mostly I think I'm just a victim of poor wording. xs:NOTATION constructor
and xs:NOTATION casting are clearly not supported, but is xs:NOTATION itself
(even as a virtual base type) supported or not?
|||Hi Mike
I think overall if you add everything up then you have to say there is no
support at all. There is no constructor so you can't create anything of that
type, you can not cast to or from so even if you had something of that type
you can't do much with it.
Have you tried using it?
John
"Mike C#" wrote:

> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:A04FBA1C-8FB5-4461-83D3-201B858C672F@.microsoft.com...
> Thanks, that seems to indicate xs:NOTATION is not supported at all. The
> fact that xs:NOTATION is included in the chart at the top of that page seems
> to contradict that wording though...
>
> Here's where the confusion comes in - xs:NOTATION is either supported (as a
> virtual base type, as indicated on the chart on the first page and alluded
> to in the quote from the second page), or it's not supported at all (as
> indicated by the wording on the first page).
> I assume the statement from the second page doesn't really indicate that
> xs:NOTATION itself is not supported, but rather that an xs:NOTATION
> constructor is not supported. That's based on the fact that xs:QName *is*
> supported (though no constructor), and it's listed in the same sentence
> where it says "...are not supported."
> Mostly I think I'm just a victim of poor wording. xs:NOTATION constructor
> and xs:NOTATION casting are clearly not supported, but is xs:NOTATION itself
> (even as a virtual base type) supported or not?
>
>
|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:AC29C43A-7507-48AF-A419-3015A4654597@.microsoft.com...
> Hi Mike
> I think overall if you add everything up then you have to say there is no
> support at all. There is no constructor so you can't create anything of
> that
> type, you can not cast to or from so even if you had something of that
> type
> you can't do much with it.
> Have you tried using it?
Consider xs:QName: ( no constructor for xs:QName + no casting to or from an
xs:QName from any other type ) != no support at all. xs:QName is definitely
supported.
I haven't tried using xs:NOTATION directly, since the chart indicates it's a
"virtual base type". Presumably other types can be created from it. I
figured the good folks from Microsoft who visit these newsgroups might be
able to shed some light on how it might be used at all if it is supported as
a "virtual base type", or explain the apparent discrepancy in the
documentation if it's not supported at all.
Thanks.
|||"Mike C#" <xyz@.xyz.com> wrote in message
news:uzrl9$HHHHA.3872@.TK2MSFTNGP06.phx.gbl...
> Consider xs:QName: ( no constructor for xs:QName + no casting to or from
> an xs:QName from any other type ) != no support at all. xs:QName is
> definitely supported.
> I haven't tried using xs:NOTATION directly, since the chart indicates it's
> a "virtual base type". Presumably other types can be created from it. I
> figured the good folks from Microsoft who visit these newsgroups might be
> able to shed some light on how it might be used at all if it is supported
> as a "virtual base type", or explain the apparent discrepancy in the
> documentation if it's not supported at all.
>
I just ran a simple test for xs:NOTATION, and the result was SQL giving me
the error message "NOTATION not supported". So it looks like it doesn't
support xs:NOTATION at all. Someone at MS should fix that chart on the
XQuery datatypes casting page.
Thanks for the help!
|||Hi Mike
The chart shows casting between QNs so it would indicate some support! It
may be interesting to see what happens if you try to construct one!!
You could try sending feedback on this using the contact us option at the
bottom of the page.
John
"Mike C#" wrote:

> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:AC29C43A-7507-48AF-A419-3015A4654597@.microsoft.com...
> Consider xs:QName: ( no constructor for xs:QName + no casting to or from an
> xs:QName from any other type ) != no support at all. xs:QName is definitely
> supported.
> I haven't tried using xs:NOTATION directly, since the chart indicates it's a
> "virtual base type". Presumably other types can be created from it. I
> figured the good folks from Microsoft who visit these newsgroups might be
> able to shed some light on how it might be used at all if it is supported as
> a "virtual base type", or explain the apparent discrepancy in the
> documentation if it's not supported at all.
> Thanks.
>
>
|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:7C916F7A-ED18-46E3-86F4-4E5B2E93D1A5@.microsoft.com...
> Hi Mike
> The chart shows casting between QNs so it would indicate some support! It
> may be interesting to see what happens if you try to construct one!!
> You could try sending feedback on this using the contact us option at the
> bottom of the page.
>
Hi John
QN's don't have a constructor function per se, but there is an F&O function
to create a QN. The QN casting is strictly QN to QN. The xs:NOTATION
doesn't even work with the "instance of" operator (which was my test), and
it comes back with the error message stating explicitly that no support for
xs:NOTATION exists, so that's what I'm going with
Thanks
|||The first thing to test is, if the type is supported in XML Schema
collections... and it is not.
CREATE XML SCHEMA COLLECTION SCX AS
N'<xsd:schema targetNamespace="urn:example/customer"
xmlns:e="urn:example/customer"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xsd:element name="buys" type="xsd:NOTATION"/>
</xsd:schema>'
returns
Msg 9337, Level 16, State 1, Line 1
The XML Schema type 'NOTATION' is not supported.
Since schema does not support the type, XQuery does not either.
If this type is important for your scenario, please file a bug report under
http://connect.microsoft.com/sqlserver
Thanks
Michael
"Mike C#" <xyz@.xyz.com> wrote in message
news:%23RoXrrTHHHA.1816@.TK2MSFTNGP06.phx.gbl...
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:7C916F7A-ED18-46E3-86F4-4E5B2E93D1A5@.microsoft.com...
> Hi John
> QN's don't have a constructor function per se, but there is an F&O
> function to create a QN. The QN casting is strictly QN to QN. The
> xs:NOTATION doesn't even work with the "instance of" operator (which was
> my test), and it comes back with the error message stating explicitly that
> no support for xs:NOTATION exists, so that's what I'm going with
> Thanks
>
|||I can work around that limitation for now. It would be nice if they could
refresh the documentation on it to get rid of xs:NOTATION from the chart and
state a little more clearly that it's not supported. Right now the
statement that it's not supported is combined with a couple of other items
that are supported in various fashions, which leads to having to do tests
like this to determine if it actually is supported or not.
Thanks.
"Michael Rys [MSFT]" <mrys@.online.microsoft.com> wrote in message
news:eFSlFP8HHHA.1248@.TK2MSFTNGP03.phx.gbl...
> The first thing to test is, if the type is supported in XML Schema
> collections... and it is not.
> CREATE XML SCHEMA COLLECTION SCX AS
> N'<xsd:schema targetNamespace="urn:example/customer"
> xmlns:e="urn:example/customer"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
> <xsd:element name="buys" type="xsd:NOTATION"/>
> </xsd:schema>'
> returns
> Msg 9337, Level 16, State 1, Line 1
> The XML Schema type 'NOTATION' is not supported.
> Since schema does not support the type, XQuery does not either.
> If this type is important for your scenario, please file a bug report
> under http://connect.microsoft.com/sqlserver
> Thanks
> Michael
> "Mike C#" <xyz@.xyz.com> wrote in message
> news:%23RoXrrTHHHA.1816@.TK2MSFTNGP06.phx.gbl...
>

[SQL 2005] XQuery xs:NOTATION

I thought I read in BOL that SQL 2K5's XQuery implementation does not
support the XML Schema xs:NOTATION datatype; but I'm having a hard time
finding that page again. I was able to locate a page in BOL
(http://msdn2.microsoft.com/en-us/library/ms191231.aspx) that indicates type
casting to/from xs:NOTATION is not supported, but need to know is
xs:NOTATION actually supported at all? Any references to this information
(one way or the other) is appreciated.
Thanks!
Hi Mike
On the page you posted
http://msdn2.microsoft.com/en-us/library/ms191231.aspx :
"xs:NOTATION and the fully ordered subtypes of duration,
xdt:yearMonthDuration and xdt:dayTimeDuration, are not supported. As a
result, casting to or from these types is not supported."
On http://msdn2.microsoft.com/pt-br/library/ms189547.aspx
"Constructors are supported for base and derived atomic XSD types. However,
the subtypes of xs:duration, which includes xdt:yearMonthDuration and
xdt:dayTimeDuration, and xs:QName, xs:NMTOKEN, and xs:NOTATION are not
supported. User-defined atomic types that are available in the associated
schema collections are also available, provided they are directly or
indirectly derived from the following types."
John
"Mike C#" wrote:

> I thought I read in BOL that SQL 2K5's XQuery implementation does not
> support the XML Schema xs:NOTATION datatype; but I'm having a hard time
> finding that page again. I was able to locate a page in BOL
> (http://msdn2.microsoft.com/en-us/library/ms191231.aspx) that indicates type
> casting to/from xs:NOTATION is not supported, but need to know is
> xs:NOTATION actually supported at all? Any references to this information
> (one way or the other) is appreciated.
> Thanks!
>
>
|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:A04FBA1C-8FB5-4461-83D3-201B858C672F@.microsoft.com...
> Hi Mike
> On the page you posted
> http://msdn2.microsoft.com/en-us/library/ms191231.aspx :
> "xs:NOTATION and the fully ordered subtypes of duration,
> xdt:yearMonthDuration and xdt:dayTimeDuration, are not supported. As a
> result, casting to or from these types is not supported."
Thanks, that seems to indicate xs:NOTATION is not supported at all. The
fact that xs:NOTATION is included in the chart at the top of that page seems
to contradict that wording though...

> On http://msdn2.microsoft.com/pt-br/library/ms189547.aspx
> "Constructors are supported for base and derived atomic XSD types.
> However,
> the subtypes of xs:duration, which includes xdt:yearMonthDuration and
> xdt:dayTimeDuration, and xs:QName, xs:NMTOKEN, and xs:NOTATION are not
> supported. User-defined atomic types that are available in the associated
> schema collections are also available, provided they are directly or
> indirectly derived from the following types."
Here's where the confusion comes in - xs:NOTATION is either supported (as a
virtual base type, as indicated on the chart on the first page and alluded
to in the quote from the second page), or it's not supported at all (as
indicated by the wording on the first page).
I assume the statement from the second page doesn't really indicate that
xs:NOTATION itself is not supported, but rather that an xs:NOTATION
constructor is not supported. That's based on the fact that xs:QName *is*
supported (though no constructor), and it's listed in the same sentence
where it says "...are not supported."
Mostly I think I'm just a victim of poor wording. xs:NOTATION constructor
and xs:NOTATION casting are clearly not supported, but is xs:NOTATION itself
(even as a virtual base type) supported or not?
|||Hi Mike
I think overall if you add everything up then you have to say there is no
support at all. There is no constructor so you can't create anything of that
type, you can not cast to or from so even if you had something of that type
you can't do much with it.
Have you tried using it?
John
"Mike C#" wrote:

> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:A04FBA1C-8FB5-4461-83D3-201B858C672F@.microsoft.com...
> Thanks, that seems to indicate xs:NOTATION is not supported at all. The
> fact that xs:NOTATION is included in the chart at the top of that page seems
> to contradict that wording though...
>
> Here's where the confusion comes in - xs:NOTATION is either supported (as a
> virtual base type, as indicated on the chart on the first page and alluded
> to in the quote from the second page), or it's not supported at all (as
> indicated by the wording on the first page).
> I assume the statement from the second page doesn't really indicate that
> xs:NOTATION itself is not supported, but rather that an xs:NOTATION
> constructor is not supported. That's based on the fact that xs:QName *is*
> supported (though no constructor), and it's listed in the same sentence
> where it says "...are not supported."
> Mostly I think I'm just a victim of poor wording. xs:NOTATION constructor
> and xs:NOTATION casting are clearly not supported, but is xs:NOTATION itself
> (even as a virtual base type) supported or not?
>
>
|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:AC29C43A-7507-48AF-A419-3015A4654597@.microsoft.com...
> Hi Mike
> I think overall if you add everything up then you have to say there is no
> support at all. There is no constructor so you can't create anything of
> that
> type, you can not cast to or from so even if you had something of that
> type
> you can't do much with it.
> Have you tried using it?
Consider xs:QName: ( no constructor for xs:QName + no casting to or from an
xs:QName from any other type ) != no support at all. xs:QName is definitely
supported.
I haven't tried using xs:NOTATION directly, since the chart indicates it's a
"virtual base type". Presumably other types can be created from it. I
figured the good folks from Microsoft who visit these newsgroups might be
able to shed some light on how it might be used at all if it is supported as
a "virtual base type", or explain the apparent discrepancy in the
documentation if it's not supported at all.
Thanks.
|||"Mike C#" <xyz@.xyz.com> wrote in message
news:uzrl9$HHHHA.3872@.TK2MSFTNGP06.phx.gbl...
> Consider xs:QName: ( no constructor for xs:QName + no casting to or from
> an xs:QName from any other type ) != no support at all. xs:QName is
> definitely supported.
> I haven't tried using xs:NOTATION directly, since the chart indicates it's
> a "virtual base type". Presumably other types can be created from it. I
> figured the good folks from Microsoft who visit these newsgroups might be
> able to shed some light on how it might be used at all if it is supported
> as a "virtual base type", or explain the apparent discrepancy in the
> documentation if it's not supported at all.
>
I just ran a simple test for xs:NOTATION, and the result was SQL giving me
the error message "NOTATION not supported". So it looks like it doesn't
support xs:NOTATION at all. Someone at MS should fix that chart on the
XQuery datatypes casting page.
Thanks for the help!
|||Hi Mike
The chart shows casting between QNs so it would indicate some support! It
may be interesting to see what happens if you try to construct one!!
You could try sending feedback on this using the contact us option at the
bottom of the page.
John
"Mike C#" wrote:

> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:AC29C43A-7507-48AF-A419-3015A4654597@.microsoft.com...
> Consider xs:QName: ( no constructor for xs:QName + no casting to or from an
> xs:QName from any other type ) != no support at all. xs:QName is definitely
> supported.
> I haven't tried using xs:NOTATION directly, since the chart indicates it's a
> "virtual base type". Presumably other types can be created from it. I
> figured the good folks from Microsoft who visit these newsgroups might be
> able to shed some light on how it might be used at all if it is supported as
> a "virtual base type", or explain the apparent discrepancy in the
> documentation if it's not supported at all.
> Thanks.
>
>
|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:7C916F7A-ED18-46E3-86F4-4E5B2E93D1A5@.microsoft.com...
> Hi Mike
> The chart shows casting between QNs so it would indicate some support! It
> may be interesting to see what happens if you try to construct one!!
> You could try sending feedback on this using the contact us option at the
> bottom of the page.
>
Hi John
QN's don't have a constructor function per se, but there is an F&O function
to create a QN. The QN casting is strictly QN to QN. The xs:NOTATION
doesn't even work with the "instance of" operator (which was my test), and
it comes back with the error message stating explicitly that no support for
xs:NOTATION exists, so that's what I'm going with
Thanks
|||The first thing to test is, if the type is supported in XML Schema
collections... and it is not.
CREATE XML SCHEMA COLLECTION SCX AS
N'<xsd:schema targetNamespace="urn:example/customer"
xmlns:e="urn:example/customer"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xsd:element name="buys" type="xsd:NOTATION"/>
</xsd:schema>'
returns
Msg 9337, Level 16, State 1, Line 1
The XML Schema type 'NOTATION' is not supported.
Since schema does not support the type, XQuery does not either.
If this type is important for your scenario, please file a bug report under
http://connect.microsoft.com/sqlserver
Thanks
Michael
"Mike C#" <xyz@.xyz.com> wrote in message
news:%23RoXrrTHHHA.1816@.TK2MSFTNGP06.phx.gbl...
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:7C916F7A-ED18-46E3-86F4-4E5B2E93D1A5@.microsoft.com...
> Hi John
> QN's don't have a constructor function per se, but there is an F&O
> function to create a QN. The QN casting is strictly QN to QN. The
> xs:NOTATION doesn't even work with the "instance of" operator (which was
> my test), and it comes back with the error message stating explicitly that
> no support for xs:NOTATION exists, so that's what I'm going with
> Thanks
>
|||I can work around that limitation for now. It would be nice if they could
refresh the documentation on it to get rid of xs:NOTATION from the chart and
state a little more clearly that it's not supported. Right now the
statement that it's not supported is combined with a couple of other items
that are supported in various fashions, which leads to having to do tests
like this to determine if it actually is supported or not.
Thanks.
"Michael Rys [MSFT]" <mrys@.online.microsoft.com> wrote in message
news:eFSlFP8HHHA.1248@.TK2MSFTNGP03.phx.gbl...
> The first thing to test is, if the type is supported in XML Schema
> collections... and it is not.
> CREATE XML SCHEMA COLLECTION SCX AS
> N'<xsd:schema targetNamespace="urn:example/customer"
> xmlns:e="urn:example/customer"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
> <xsd:element name="buys" type="xsd:NOTATION"/>
> </xsd:schema>'
> returns
> Msg 9337, Level 16, State 1, Line 1
> The XML Schema type 'NOTATION' is not supported.
> Since schema does not support the type, XQuery does not either.
> If this type is important for your scenario, please file a bug report
> under http://connect.microsoft.com/sqlserver
> Thanks
> Michael
> "Mike C#" <xyz@.xyz.com> wrote in message
> news:%23RoXrrTHHHA.1816@.TK2MSFTNGP06.phx.gbl...
>

Thursday, February 16, 2012

[database_name . [schema_name ] . | schema_name . ] table_name

Hi,
I try to create 2 schema as the syntax display's as below, but I get a error
of only use 1. Do I have to change any parameters in SQL 2005?
And will I get any other problems in the future to use 2 schema?
Syntax
CREATE TABLE
[ database_name . [ schema_name ] . | schema_name . ] table_name> Hi,
> I try to create 2 schema as the syntax display's as below, but I get a
> error
> of only use 1.
Can you show the ACTUAL syntax you tried, and the EXACT error message?
The syntax you show demonstrates two options:
CREATE TABLE master.schema1.table
CREATE TABLE schema1.table
It sounds like you maybe misinterpreted it as:
CREATE TABLE master.schema1.schema2.table
?

> Do I have to change any parameters in SQL 2005?
> And will I get any other problems in the future to use 2 schema?
> Syntax
> CREATE TABLE
> [ database_name . [ schema_name ] . | schema_name . ] table_name|||The schema concept is not hierarchical. An object is contained in a schema,
not a level of schemas.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"RBC" <RBC@.discussions.microsoft.com> wrote in message
news:DD3B310F-B41C-45E5-AEC9-C5F2DD1A12C4@.microsoft.com...
> Hi,
> I try to create 2 schema as the syntax display's as below, but I get a err
or
> of only use 1. Do I have to change any parameters in SQL 2005?
> And will I get any other problems in the future to use 2 schema?
> Syntax
> CREATE TABLE
> [ database_name . [ schema_name ] . | schema_name . ] table_name

[database_name . [schema_name ] . | schema_name . ] table_na

Hi,
Create Schema.TableName (No Problem)
Create Schema1.schema2.TableName (Problem SQL see schema1 as the database)
Create Database,schema1.schema2.TableName (Error below)
Msg 117, Level 15, State 1, Line 13
The object name 'DatabasName.Schema1. Schema2.TableName' contains more than
the maximum number of prefixes. The maximum is 2.
Msg 319, Level 15, State 1, Line 84
Incorrect syntax near the keyword 'with'. If this statement is a common
table expression or an xmlnamespaces clause, the previous statement must be
terminated with a semicolon.
"Aaron Bertrand [SQL Server MVP]" wrote:

> Can you show the ACTUAL syntax you tried, and the EXACT error message?
> The syntax you show demonstrates two options:
> CREATE TABLE master.schema1.table
> CREATE TABLE schema1.table
> It sounds like you maybe misinterpreted it as:
> CREATE TABLE master.schema1.schema2.table
> ?
>
>
>> Create Schema1.schema2.TableName (Problem SQL see schema1 as the database)
Yes, because you can't nest schemas.

> Create Database,schema1.schema2.TableName (Error below)
You still can't nest schemas. A schema can't own a schema, there is only
one "level" for it in the heirarchy.|||You can nest schemas according to the syntax. Do you claim the syntax is wro
ng?
Syntax
CREATE TABLE
[ database_name . [ schema_name ] . | schema_name . ] table_name
"Aaron Bertrand [SQL Server MVP]" wrote:

> Yes, because you can't nest schemas.
>
> You still can't nest schemas. A schema can't own a schema, there is only
> one "level" for it in the heirarchy.
>
>|||> You can nest schemas according to the syntax. Do you claim the syntax is
> wrong?
> Syntax
> CREATE TABLE
> [ database_name . [ schema_name ] . | schema_name . ] table_name
No, the syntax is not wrong. Your interpretation of the syntax is wrong, as
several people have already pointed out.
The syntax says you can do:
CREATE TABLE databasename.schemaname.tablename
or
CREATE TABLE schemaname.tablename
or
CREATE TABLE tablename
[[this.that]|or this but not both.]tablename
Go ahead and file a bug that the documentation is wrong as per your
interpretation. But the following fact remains the same: YOU CANNOT NEST
SCHEMAS, EVEN IF YOU INTERPRET THE DOCUMENTATION INCORRECTLY.|||I think you only have to change the parameter from 2 to 3 (Error message),
and we are fine.
I found 1 person by searching the Internet who had the error 3, who tried to
write 3 schemas by including dbo in his syntax...
Thank you,
Rune
"Aaron Bertrand [SQL Server MVP]" wrote:

> No, the syntax is not wrong. Your interpretation of the syntax is wrong,
as
> several people have already pointed out.
> The syntax says you can do:
> CREATE TABLE databasename.schemaname.tablename
> or
> CREATE TABLE schemaname.tablename
> or
> CREATE TABLE tablename
> [[this.that]|or this but not both.]tablename
> Go ahead and file a bug that the documentation is wrong as per your
> interpretation. But the following fact remains the same: YOU CANNOT NEST
> SCHEMAS, EVEN IF YOU INTERPRET THE DOCUMENTATION INCORRECTLY.
>
>|||>I think you only have to change the parameter from 2 to 3 (Error message),
> and we are fine.
> I found 1 person by searching the Internet who had the error 3, who tried
> to
> write 3 schemas by including dbo in his syntax...
Now I have absolutely no idea what you are talking about.
In summary: YOU CANNOT NEST SCHEMAS.

[database_name . [schema_name ] . | schema_name . ] table_na

The schema is hierachical according to the syntax. Do you claim the syntax i
s
wrong?
Syntax
CREATE TABLE
[ database_name . [ schema_name ] . | schema_name . ] table_name
"Tibor Karaszi" wrote:

> The schema concept is not hierarchical. An object is contained in a schema
, not a level of schemas.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "RBC" <RBC@.discussions.microsoft.com> wrote in message
> news:DD3B310F-B41C-45E5-AEC9-C5F2DD1A12C4@.microsoft.com...
>Hi RBC
No, this is not hierarchical. You are not reading the syntax correctly.
Please see
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/35fbcf7f-8b55-46cd-a957-
9b8c7b311241.htm
in the SQL Server 2005 Books Online which explains how to read the syntax
specifications.
In particular:
| (vertical bar)
Separates syntax items within brackets or braces. You can choose only
one of the items.
[ ] (brackets)
Optional syntax items. Do not type the brackets.
The syntax you show has a vertical bar inside brackets. That means you
choose either what is before the bar or what is after.
The table name is the only element requirement.
Before the table name you can optionally have EITHER a databasename and an
optional schema name OR a schema name.
HTH
Kalen Delaney, SQL Server MVP
"RBC" <RBC@.discussions.microsoft.com> wrote in message
news:848C392A-6DF4-41B5-A1EB-249945C2EEF5@.microsoft.com...
> The schema is hierachical according to the syntax. Do you claim the syntax
> is
> wrong?
> Syntax
> CREATE TABLE
> [ database_name . [ schema_name ] . | schema_name . ] table_name
>
> "Tibor Karaszi" wrote:
>|||Hi Kalen,
You are right...
Thank you
It had been perfect for my development with 2 schema...
Rune
"Kalen Delaney" wrote:

> Hi RBC
> No, this is not hierarchical. You are not reading the syntax correctly.
> Please see
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/35fbcf7f-8b55-46cd-a95
7-9b8c7b311241.htm
> in the SQL Server 2005 Books Online which explains how to read the syntax
> specifications.
> In particular:
> | (vertical bar)
> Separates syntax items within brackets or braces. You can choose only
> one of the items.
>
> [ ] (brackets)
> Optional syntax items. Do not type the brackets.
>
> The syntax you show has a vertical bar inside brackets. That means you
> choose either what is before the bar or what is after.
> The table name is the only element requirement.
> Before the table name you can optionally have EITHER a databasename and an
> optional schema name OR a schema name.
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "RBC" <RBC@.discussions.microsoft.com> wrote in message
> news:848C392A-6DF4-41B5-A1EB-249945C2EEF5@.microsoft.com...
>
>

Monday, February 13, 2012

[2005 Express]Add SPs to a Schema?

I have SQL Server 2005 Express set up on a PC. I imported a backup of an MSDE database. All of the database objects are there. However, I need to assign permissions to my Stored Procedures. So, using Management Studio Express, I saw absolutely no way of adding a stored procedure to a schema or to a user. So I downloaded SQL Server 2005 Developer from my MSDN account. I installed the client tools to get the full version of Management Studio. Same thing. No way to add permissions to a SP. Some web articles say to right-click the SP and select Properties. However, there is no "Properties" in the right-click menu!!! There is only Rename, Delete, Modify, etc. How can something so easy with an old product be so difficult with a new one? Does anyone know how to accomplish adding permissions to SPs?

I can right-click a table or a View and get the popup window with the list view and contents to set permissions to tables and views.On my build of SSMS, I do have a properties context menu off of any sproc in OE, and when I click it I can add perms to the sproc. I have this build: 9.00.2047.00. which do you have?

I am thinking perhaps this is due to a bad reaction between SSMS and SSMSE perhaps. EDIT: Is that redundant? :)

If nothig else works, I would try unistalling them both and the reistalling only SSMS.|||I have build 9.00.1399.00, so it is an older version. This build was from MSDN Subscription Downloads, on Disk 2 for SQL Server 2005 Developer. Do you know where I could download an update/the latest version?

UPDATE: I uninstalled and then reinstalled all of the SQL Server Workstation stuff. Then, I installed an instance of SQL Server 2005 Developer on my test PC. Now, with SSMS, I can right-click and get "Properties" for stored Procedures in the SQL Server 2005 instance, but I still can't get the right-click "Properties" in the Express instance. Is this a limitation of Express?|||Yes, I think this is a limitation of ssmse.

The sql express GUI is very limited in what it does. it's meant to be a teaser to make it more attractive for people to start using sql server instead of mysql, but then upgrade to a pay version once they are addicted. :)

EDIT: I am running sp1 - I think that's the difference between our two version numbers. You can download sp1 from here: http://www.microsoft.com/sql/sp1.mspx|||Oh, I see. Even the Management Studio updates are included in the SQL Server service pack, huh? I'll have to apply that. Thanks.|||oh yea. UI devs put bugs in their code too. :)|||Well, overall, I can get the Express instance to run the SPs from my VB.NET code. I used ALTER to put them into a new schema, and gave the user account that connects from my intranet app permissions on that schema. This allows the app to run the SPs. It's odd, what use is setting permissions on the specific SP (in the Developer instance, or course) when just using the schema allows execution? Is it to be more granular with permissions and, say, deny permissions on a specific SP within a schema to a schema user?|||that's one of the points of using schemas.

note that an explicit deny on a sproc should override any indirect grant (thru a schema).