Monday, March 26, 2012
Refreshing report problem
I did my report under a schema called billing and the new data is in schema called inteltest. Even i connect to the crystal reports using inteltest in the sql query it shows schema as billing4 . please help meHi, In the report goto File and see "Save Data wtih Report" option. If it is checked then uncheck it and save the report
Madhivanan
refresh SSIS pkg to get the change
How do you refresh a SSIS pkg to get the latest table schema change?
I have this data flow task that will load data from a flat file into a table.
I got a Warning: Truncation may occur due to retrieving data from database column "txtSNumber" with a length of 50 to data flow column "txtSNumber" with a length of 20.
Then I went into Management Studio and changed the column size.
Now in my dev BID I got next:
[SQL Server 05[82]] Warning: The external metadata column collection is out of synchronization with the data source columns. The column "txt..." needs to be updated in the external metadata column collection.
I think this means my change on the table did not get into my ssis, and I could not find a way to refresh.
Thanks!It actually means the opposite. The change was detected by SSIS and it needs to update the metadata associated with the table in the data flow task (i.e. change the column width from 20 to 50). It does not automatically do this without some user interaction (hitting "OK") since you may need to know about the change and correct it if it is incorrect.|||
Thanks for the reply.
I am not looking for the automatic way to refresh if there is one.
I want to manually start the process in my design environment and click the OK as you have suggested, but I could not find out how or from where to make it happen.
I have tried right click on my .dtsx and select reload with upgrade, but that is not it. Where can tap into the megadata?
|||Look at the components in your data flow that have the yellow triangle with an exclamation mark in it. Start there by double clicking on that component to refresh the metadata.|||Double click on the yellow mark is the trick! Thanks!Wednesday, March 21, 2012
referential integrity
implement referential integrity across the tables in the database?
If true is it purely for ETL purposes or does it improve query performance
if the referential integrity is not applied to the tables.
OllieMost of the sql server implementations (both OLTP and OLAP) I have seen in
my many years of consulting on the product have not had much if any ref.
integrity in place. RF can provide the optimizer with useful information,
yet it also takes overhead to maintain/enforce. And without it you get
fewer application errors - yet allow in bad data. Most designers/developers
seem to take the easy road . . .
TheSQLGuru
President
Indicium Resources, Inc.
"news.microsoft.com" <ollie_riches@.hotmail.com> wrote in message
news:uIbwJ7zsHHA.400@.TK2MSFTNGP02.phx.gbl...
> When implementing a schema for data warehousing is it common practice not
> to implement referential integrity across the tables in the database?
> If true is it purely for ETL purposes or does it improve query performance
> if the referential integrity is not applied to the tables.
> Ollie
>|||Yes, this is very common in a data warehouse. In OLTP databases, DRI is
VERY important to ensure the referential integrity of the data because the
data is coming in from applications and possibly other places. In a data
warehouse, the ONLY way data should ever get into your warehouse is through
your ETL process(es). Since these processes should always do thorough
checking of the data inclusing references, you can safely remove the DRI
since it can speed up the ETL loads. However, I always include it by
default even in warehouses as an extra safety check and only remove it if
needed for the performance boost (only ever had to do this twice in many
years when it involved loading 10's to 100's of millions of rows a night in
a tight window of time.
"news.microsoft.com" <ollie_riches@.hotmail.com> wrote in message
news:uIbwJ7zsHHA.400@.TK2MSFTNGP02.phx.gbl...
> When implementing a schema for data warehousing is it common practice not
> to implement referential integrity across the tables in the database?
> If true is it purely for ETL purposes or does it improve query performance
> if the referential integrity is not applied to the tables.
> Ollie
>|||On Jun 20, 3:27 pm, "news.microsoft.com" <ollie_ric...@.hotmail.com>
wrote:
> When implementing a schema for data warehousing is it common practice not
to
> implement referential integrity across the tables in the database?
> If true is it purely for ETL purposes or does it improve query performance
> if the referential integrity is not applied to the tables.
> Ollie
I prefer having referential integrity enabled on the development
environment, removing it in production.
It has the benefit of helping ETL developers finding errors very early
and clearly.
Marco Russo
http://www.sqlbi.eu
http://sqlblog.com/blogs/marco_russo|||same for me.
yes in dev
no in prod.
"Marco Russo" <marco.russo@.loader.it> wrote in message
news:1182449884.703796.298200@.n2g2000hse.googlegroups.com...
> On Jun 20, 3:27 pm, "news.microsoft.com" <ollie_ric...@.hotmail.com>
> wrote:
> I prefer having referential integrity enabled on the development
> environment, removing it in production.
> It has the benefit of helping ETL developers finding errors very early
> and clearly.
> Marco Russo
> http://www.sqlbi.eu
> http://sqlblog.com/blogs/marco_russo
>sql
referential integrity
wrote:
> When implementing a schema for data warehousing is it common practice not to
> implement referential integrity across the tables in the database?
> If true is it purely for ETL purposes or does it improve query performance
> if the referential integrity is not applied to the tables.
> Ollie
I prefer having referential integrity enabled on the development
environment, removing it in production.
It has the benefit of helping ETL developers finding errors very early
and clearly.
Marco Russo
http://www.sqlbi.eu
http://sqlblog.com/blogs/marco_russo
same for me.
yes in dev
no in prod.
"Marco Russo" <marco.russo@.loader.it> wrote in message
news:1182449884.703796.298200@.n2g2000hse.googlegro ups.com...
> On Jun 20, 3:27 pm, "news.microsoft.com" <ollie_ric...@.hotmail.com>
> wrote:
> I prefer having referential integrity enabled on the development
> environment, removing it in production.
> It has the benefit of helping ETL developers finding errors very early
> and clearly.
> Marco Russo
> http://www.sqlbi.eu
> http://sqlblog.com/blogs/marco_russo
>
Referencing xs:schema within a SCHEMA COLLECTION
I have an XML schema that has an element declaration that references a W3C
XML Schema type:
<xs:import namespace="http://www.w3.org/2001/XMLSchema"/>
. . .
<xs:element ref="xs:schema"/>
When I try and import this schema into a SQL SCHEMA COLLECTION, I get an
error:
Msg 2308, Level 16, State 1, Line 1
Reference to an undefined name 'schema' within namespace
'http://www.w3.org/2001/XMLSchema'
The problem is obviously that the schema processor does not have a copy of
the W3C XML Schema, uh, schema handy. I tried getting a copy of the XML
Schema reference from the W3C and cleaning up the documentation nodes
(riddled with single quotes). The schema processor then gave me an "invalid
target namespace specified error.
Any ideas for having a node that contains a schema? How would the schema
for WSDL be accepted? Thanks,
- ErikHi Eric,
You don't need to import the schema for schemas (apparently it even causes
problems) because its built-in to SQL Server 2005. Just refer to it in your
schema. Like this:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ...more >
...
<xs:element name="yourtype" type="xs:string" />
</xs:schema>
Deriving types would work the same way.
Weird error message, I'll admit.
Hope this helps,
Bob Beauchemin
http://www.SQLskills.com/blogs/bobb
"Erik J." <ErikJ@.discussions.microsoft.com> wrote in message
news:E4DBFFC7-28FF-4C89-BD0A-F31502BA3E36@.microsoft.com...
> Hi all,
> I have an XML schema that has an element declaration that references a W3C
> XML Schema type:
> <xs:import namespace="http://www.w3.org/2001/XMLSchema"/>
> . . .
> <xs:element ref="xs:schema"/>
> When I try and import this schema into a SQL SCHEMA COLLECTION, I get an
> error:
> Msg 2308, Level 16, State 1, Line 1
> Reference to an undefined name 'schema' within namespace
> 'http://www.w3.org/2001/XMLSchema'
> The problem is obviously that the schema processor does not have a copy of
> the W3C XML Schema, uh, schema handy. I tried getting a copy of the XML
> Schema reference from the W3C and cleaning up the documentation nodes
> (riddled with single quotes). The schema processor then gave me an
> "invalid
> target namespace specified error.
> Any ideas for having a node that contains a schema? How would the schema
> for WSDL be accepted? Thanks,
> - Erik
>|||Thanks Bob.
If I declare the schema type as xs:string, I'll have to escape XML markup in
the embedded schema node. The work-around I picked instead was to declare a
n
xs:any rather than an xs:element. I can tell the schema process to skip
processing on the embedded node that way.
But I really wanted to have SQL Server validate my documents fully,
including the embedded schemas. I'll think about that over the w

let everyone know what I come up with.
Cheers,
Erik Johnson
http://appside.blogspot.com
"Bob Beauchemin" wrote:
> Hi Eric,
> You don't need to import the schema for schemas (apparently it even causes
> problems) because its built-in to SQL Server 2005. Just refer to it in you
r
> schema. Like this:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ...more >
> ...
> <xs:element name="yourtype" type="xs:string" />
> </xs:schema>
> Deriving types would work the same way.
> Weird error message, I'll admit.
> Hope this helps,
> Bob Beauchemin
> http://www.SQLskills.com/blogs/bobb
>
> "Erik J." <ErikJ@.discussions.microsoft.com> wrote in message
> news:E4DBFFC7-28FF-4C89-BD0A-F31502BA3E36@.microsoft.com...
>
>|||Hi Erik, could you please send me email to describe what you would like to
do? We then can take a look at why it is not working.
Note that the Schema for the W3C Schema is not a valid schema in its own.
Best regards
Michael
"Erik J." <ErikJ@.discussions.microsoft.com> wrote in message
news:228DE552-E347-4906-A1E0-F321E00FF3BC@.microsoft.com...
> Thanks Bob.
> If I declare the schema type as xs:string, I'll have to escape XML markup
> in
> the embedded schema node. The work-around I picked instead was to declare
> an
> xs:any rather than an xs:element. I can tell the schema process to skip
> processing on the embedded node that way.
> But I really wanted to have SQL Server validate my documents fully,
> including the embedded schemas. I'll think about that over the w

> and
> let everyone know what I come up with.
> Cheers,
> Erik Johnson
> http://appside.blogspot.com
> "Bob Beauchemin" wrote:
>|||Hi Michael,
Thanks for looking into this. We are creating some schemas for XML
documents that contain XML schemas. Here is a simple example:
CREATE XML SCHEMA COLLECTION TestSchemas AS
'<xs:schema id="Noun"
targetNamespace="http://tempuri.org/Noun.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/Noun.xsd"
xmlns:mstns="http://tempuri.org/Noun.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://www.w3.org/2001/XMLSchema" />
<xs:element name="Noun">
<xs:complexType>
<xs:sequence>
<xs:element ref="xs:schema" />
</xs:sequence>
<xs:attribute name="uri" use="required">
<xs:simpleType>
<xs:restriction base="xs:anyURI"/>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>'
I get this message:
Msg 2308, Level 16, State 1, Line 1
Reference to an undefined name 'schema' within namespace
'http://www.w3.org/2001/XMLSchema'
And you are right. The sample XSD on the W3C website is not usable,
although I tried to shoehorn it! Thanks again,
- Erik
"Michael Rys [MSFT]" wrote:
> Hi Erik, could you please send me email to describe what you would like to
> do? We then can take a look at why it is not working.
> Note that the Schema for the W3C Schema is not a valid schema in its own.
> Best regards
> Michael
> "Erik J." <ErikJ@.discussions.microsoft.com> wrote in message
> news:228DE552-E347-4906-A1E0-F321E00FF3BC@.microsoft.com...
>
>|||I see. Even if you remove the import, this fails. Also means that I can't
catalog the schemas in the WSDL file put out by SQL Server 2005 XML Web
Services feature. For example,
http://schemas.microsoft.com/sqlserver/2004/SOAP/types. Even if I change the
target namespace. Hmmm...
Bob Beauchemin
http://www.SQLskills.com/blogs/bobb
"Erik J." <ErikJ@.discussions.microsoft.com> wrote in message
news:EDC61844-1E9B-4B71-8B15-4686FAAB8A5F@.microsoft.com...
> Hi Michael,
> Thanks for looking into this. We are creating some schemas for XML
> documents that contain XML schemas. Here is a simple example:
> CREATE XML SCHEMA COLLECTION TestSchemas AS
> '<xs:schema id="Noun"
> targetNamespace="http://tempuri.org/Noun.xsd"
> elementFormDefault="qualified"
> xmlns="http://tempuri.org/Noun.xsd"
> xmlns:mstns="http://tempuri.org/Noun.xsd"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:import namespace="http://www.w3.org/2001/XMLSchema" />
> <xs:element name="Noun">
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="xs:schema" />
> </xs:sequence>
> <xs:attribute name="uri" use="required">
> <xs:simpleType>
> <xs:restriction base="xs:anyURI"/>
> </xs:simpleType>
> </xs:attribute>
> </xs:complexType>
> </xs:element>
> </xs:schema>'
> I get this message:
> Msg 2308, Level 16, State 1, Line 1
> Reference to an undefined name 'schema' within namespace
> 'http://www.w3.org/2001/XMLSchema'
> And you are right. The sample XSD on the W3C website is not usable,
> although I tried to shoehorn it! Thanks again,
> - Erik
>
> "Michael Rys [MSFT]" wrote:
>
Referencing xs:schema within a SCHEMA COLLECTION
I have an XML schema that has an element declaration that references a W3C
XML Schema type:
<xs:import namespace="http://www.w3.org/2001/XMLSchema"/>
. . .
<xs:element ref="xs:schema"/>
When I try and import this schema into a SQL SCHEMA COLLECTION, I get an
error:
Msg 2308, Level 16, State 1, Line 1
Reference to an undefined name 'schema' within namespace
'http://www.w3.org/2001/XMLSchema'
The problem is obviously that the schema processor does not have a copy of
the W3C XML Schema, uh, schema handy. I tried getting a copy of the XML
Schema reference from the W3C and cleaning up the documentation nodes
(riddled with single quotes). The schema processor then gave me an "invalid
target namespace specified error.
Any ideas for having a node that contains a schema? How would the schema
for WSDL be accepted? Thanks,
- Erik
Hi Eric,
You don't need to import the schema for schemas (apparently it even causes
problems) because its built-in to SQL Server 2005. Just refer to it in your
schema. Like this:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ...more >
...
<xs:element name="yourtype" type="xs:string" />
</xs:schema>
Deriving types would work the same way.
Weird error message, I'll admit.
Hope this helps,
Bob Beauchemin
http://www.SQLskills.com/blogs/bobb
"Erik J." <ErikJ@.discussions.microsoft.com> wrote in message
news:E4DBFFC7-28FF-4C89-BD0A-F31502BA3E36@.microsoft.com...
> Hi all,
> I have an XML schema that has an element declaration that references a W3C
> XML Schema type:
> <xs:import namespace="http://www.w3.org/2001/XMLSchema"/>
> . . .
> <xs:element ref="xs:schema"/>
> When I try and import this schema into a SQL SCHEMA COLLECTION, I get an
> error:
> Msg 2308, Level 16, State 1, Line 1
> Reference to an undefined name 'schema' within namespace
> 'http://www.w3.org/2001/XMLSchema'
> The problem is obviously that the schema processor does not have a copy of
> the W3C XML Schema, uh, schema handy. I tried getting a copy of the XML
> Schema reference from the W3C and cleaning up the documentation nodes
> (riddled with single quotes). The schema processor then gave me an
> "invalid
> target namespace specified error.
> Any ideas for having a node that contains a schema? How would the schema
> for WSDL be accepted? Thanks,
> - Erik
>
|||Thanks Bob.
If I declare the schema type as xs:string, I'll have to escape XML markup in
the embedded schema node. The work-around I picked instead was to declare an
xs:any rather than an xs:element. I can tell the schema process to skip
processing on the embedded node that way.
But I really wanted to have SQL Server validate my documents fully,
including the embedded schemas. I'll think about that over the weekend and
let everyone know what I come up with.
Cheers,
Erik Johnson
http://appside.blogspot.com
"Bob Beauchemin" wrote:
> Hi Eric,
> You don't need to import the schema for schemas (apparently it even causes
> problems) because its built-in to SQL Server 2005. Just refer to it in your
> schema. Like this:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ...more >
> ...
> <xs:element name="yourtype" type="xs:string" />
> </xs:schema>
> Deriving types would work the same way.
> Weird error message, I'll admit.
> Hope this helps,
> Bob Beauchemin
> http://www.SQLskills.com/blogs/bobb
>
> "Erik J." <ErikJ@.discussions.microsoft.com> wrote in message
> news:E4DBFFC7-28FF-4C89-BD0A-F31502BA3E36@.microsoft.com...
>
>
|||Hi Erik, could you please send me email to describe what you would like to
do? We then can take a look at why it is not working.
Note that the Schema for the W3C Schema is not a valid schema in its own.
Best regards
Michael
"Erik J." <ErikJ@.discussions.microsoft.com> wrote in message
news:228DE552-E347-4906-A1E0-F321E00FF3BC@.microsoft.com...[vbcol=seagreen]
> Thanks Bob.
> If I declare the schema type as xs:string, I'll have to escape XML markup
> in
> the embedded schema node. The work-around I picked instead was to declare
> an
> xs:any rather than an xs:element. I can tell the schema process to skip
> processing on the embedded node that way.
> But I really wanted to have SQL Server validate my documents fully,
> including the embedded schemas. I'll think about that over the weekend
> and
> let everyone know what I come up with.
> Cheers,
> Erik Johnson
> http://appside.blogspot.com
> "Bob Beauchemin" wrote:
|||Hi Michael,
Thanks for looking into this. We are creating some schemas for XML
documents that contain XML schemas. Here is a simple example:
CREATE XML SCHEMA COLLECTION TestSchemas AS
'<xs:schema id="Noun"
targetNamespace="http://tempuri.org/Noun.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/Noun.xsd"
xmlns:mstns="http://tempuri.org/Noun.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://www.w3.org/2001/XMLSchema" />
<xs:element name="Noun">
<xs:complexType>
<xs:sequence>
<xs:element ref="xs:schema" />
</xs:sequence>
<xs:attribute name="uri" use="required">
<xs:simpleType>
<xs:restriction base="xs:anyURI"/>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>'
I get this message:
Msg 2308, Level 16, State 1, Line 1
Reference to an undefined name 'schema' within namespace
'http://www.w3.org/2001/XMLSchema'
And you are right. The sample XSD on the W3C website is not usable,
although I tried to shoehorn it! Thanks again,
- Erik
"Michael Rys [MSFT]" wrote:
> Hi Erik, could you please send me email to describe what you would like to
> do? We then can take a look at why it is not working.
> Note that the Schema for the W3C Schema is not a valid schema in its own.
> Best regards
> Michael
> "Erik J." <ErikJ@.discussions.microsoft.com> wrote in message
> news:228DE552-E347-4906-A1E0-F321E00FF3BC@.microsoft.com...
>
>
|||I see. Even if you remove the import, this fails. Also means that I can't
catalog the schemas in the WSDL file put out by SQL Server 2005 XML Web
Services feature. For example,
http://schemas.microsoft.com/sqlserver/2004/SOAP/types. Even if I change the
target namespace. Hmmm...
Bob Beauchemin
http://www.SQLskills.com/blogs/bobb
"Erik J." <ErikJ@.discussions.microsoft.com> wrote in message
news:EDC61844-1E9B-4B71-8B15-4686FAAB8A5F@.microsoft.com...[vbcol=seagreen]
> Hi Michael,
> Thanks for looking into this. We are creating some schemas for XML
> documents that contain XML schemas. Here is a simple example:
> CREATE XML SCHEMA COLLECTION TestSchemas AS
> '<xs:schema id="Noun"
> targetNamespace="http://tempuri.org/Noun.xsd"
> elementFormDefault="qualified"
> xmlns="http://tempuri.org/Noun.xsd"
> xmlns:mstns="http://tempuri.org/Noun.xsd"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:import namespace="http://www.w3.org/2001/XMLSchema" />
> <xs:element name="Noun">
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="xs:schema" />
> </xs:sequence>
> <xs:attribute name="uri" use="required">
> <xs:simpleType>
> <xs:restriction base="xs:anyURI"/>
> </xs:simpleType>
> </xs:attribute>
> </xs:complexType>
> </xs:element>
> </xs:schema>'
> I get this message:
> Msg 2308, Level 16, State 1, Line 1
> Reference to an undefined name 'schema' within namespace
> 'http://www.w3.org/2001/XMLSchema'
> And you are right. The sample XSD on the W3C website is not usable,
> although I tried to shoehorn it! Thanks again,
> - Erik
>
> "Michael Rys [MSFT]" wrote:
Monday, March 12, 2012
Reference to an undefined name !
I am trying to add a XML schema but I get this error for the following XSD.
Msg 2307, Level 16, State 1, Line 1
Reference to an undefined name 'fullpersoninfo'
What am I doing wrong?. Please help!
******************
create XML schema collection test_schema_coll
as
N'<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" targetNamespace="http://MyXMLDocSchema">
<xs:element name="employee" type="fullpersoninfo">
<xs:complexType name="personinfo">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="fullpersoninfo">
<xs:complexContent>
<xs:extension base="personinfo">
<xs:sequence>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:schema>'
******************
Thanks,
GaneshHi Ganesh,
Couple of things:
1. You need to define a namespace prefix for the items in your new schema in
order to refer to them. Else, you're referring to a type in no namespace.
2. Your global element declaration is surrounding the definition of your
complexTypes.
Hope this helps
Bob Beauchemin
http://www.SQLskills.com/blogs/bobb
Here's one that works:
create XML schema collection test_schema_coll
as
N'<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://MyXMLDocSchema"
elementFormDefault="qualified" targetNamespace="http://MyXMLDocSchema">
<!-- personinfo in the target namspace -->
<xs:complexType name="personinfo">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<!-- fullpersoninfo in the target namspace -->
<!-- extention of tns:personinfo, not personinfo in no namespace -->
<xs:complexType name="fullpersoninfo">
<xs:complexContent>
<xs:extension base="tns:personinfo">
<xs:sequence>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- global element declaration using tns:fullpersoninfo -->
<!-- moved to bottom -->
<!-- not fullpersoninfo in no namespace -->
<xs:element name="employee" type="tns:fullpersoninfo">
</xs:element>
</xs:schema>'
"Ganesh Muthuvelu" <GaneshMuthuvelu@.discussions.microsoft.com> wrote in
message news:BBB836E3-1EEE-4333-A884-360340A52B1A@.microsoft.com...
> Hello all,
> I am trying to add a XML schema but I get this error for the following
> XSD.
> Msg 2307, Level 16, State 1, Line 1
> Reference to an undefined name 'fullpersoninfo'
> What am I doing wrong?. Please help!
> ******************
> create XML schema collection test_schema_coll
> as
> N'<?xml version="1.0"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified" targetNamespace="http://MyXMLDocSchema">
> <xs:element name="employee" type="fullpersoninfo">
> <xs:complexType name="personinfo">
> <xs:sequence>
> <xs:element name="firstname" type="xs:string"/>
> <xs:element name="lastname" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> <xs:complexType name="fullpersoninfo">
> <xs:complexContent>
> <xs:extension base="personinfo">
> <xs:sequence>
> <xs:element name="address" type="xs:string"/>
> <xs:element name="city" type="xs:string"/>
> <xs:element name="country" type="xs:string"/>
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> </xs:element>
> </xs:schema>'
> ******************
> Thanks,
> Ganesh
Reference to an undefined name !
I am trying to add a XML schema but I get this error for the following XSD.
Msg 2307, Level 16, State 1, Line 1
Reference to an undefined name 'fullpersoninfo'
What am I doing wrong?. Please help!
******************
create XML schema collection test_schema_coll
as
N'<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" targetNamespace="http://MyXMLDocSchema">
<xs:element name="employee" type="fullpersoninfo">
<xs:complexType name="personinfo">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="fullpersoninfo">
<xs:complexContent>
<xs:extension base="personinfo">
<xs:sequence>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:schema>'
******************
Thanks,
Ganesh
Hi Ganesh,
Couple of things:
1. You need to define a namespace prefix for the items in your new schema in
order to refer to them. Else, you're referring to a type in no namespace.
2. Your global element declaration is surrounding the definition of your
complexTypes.
Hope this helps
Bob Beauchemin
http://www.SQLskills.com/blogs/bobb
Here's one that works:
create XML schema collection test_schema_coll
as
N'<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://MyXMLDocSchema"
elementFormDefault="qualified" targetNamespace="http://MyXMLDocSchema">
<!-- personinfo in the target namspace -->
<xs:complexType name="personinfo">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<!-- fullpersoninfo in the target namspace -->
<!-- extention of tns:personinfo, not personinfo in no namespace -->
<xs:complexType name="fullpersoninfo">
<xs:complexContent>
<xs:extension base="tns:personinfo">
<xs:sequence>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- global element declaration using tns:fullpersoninfo -->
<!-- moved to bottom -->
<!-- not fullpersoninfo in no namespace -->
<xs:element name="employee" type="tns:fullpersoninfo">
</xs:element>
</xs:schema>'
"Ganesh Muthuvelu" <GaneshMuthuvelu@.discussions.microsoft.com> wrote in
message news:BBB836E3-1EEE-4333-A884-360340A52B1A@.microsoft.com...
> Hello all,
> I am trying to add a XML schema but I get this error for the following
> XSD.
> Msg 2307, Level 16, State 1, Line 1
> Reference to an undefined name 'fullpersoninfo'
> What am I doing wrong?. Please help!
> ******************
> create XML schema collection test_schema_coll
> as
> N'<?xml version="1.0"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified" targetNamespace="http://MyXMLDocSchema">
> <xs:element name="employee" type="fullpersoninfo">
> <xs:complexType name="personinfo">
> <xs:sequence>
> <xs:element name="firstname" type="xs:string"/>
> <xs:element name="lastname" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> <xs:complexType name="fullpersoninfo">
> <xs:complexContent>
> <xs:extension base="personinfo">
> <xs:sequence>
> <xs:element name="address" type="xs:string"/>
> <xs:element name="city" type="xs:string"/>
> <xs:element name="country" type="xs:string"/>
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> </xs:element>
> </xs:schema>'
> ******************
> Thanks,
> Ganesh
Wednesday, March 7, 2012
Reefernce dimensions
We have designed a schema which has some snowflakes which we implement as Reference dimensions in SSAS. This design seems to be the most logical given that we have a dimension table called Portfolio, which has a number of related dimensions such as Client, Employee and Product. Instead of direcrly joining all these tables to the Positions fact table, we set them up as Reference dimensions via Portfolio.
I have read in a number of places (Lachev, Mundy) that there may be some issues with this approach, particularly on performance. Are there any metrics on what sort of performance degradation there may be? Does it depend on the number of Reference dimensions? Is it generally better if possible to always use the Standard dimensions by denormalising to a star schema - that is making Client, Employee and Product join directly to the fact table? Are there any other advantages or disadvantages, such as in the ease of data maintenance?
I would be grateful for any feedback on this.
I don't know what the performance implications of Reference dimensions are, other than that you should select the "Materialize" option on the Usage dialog, to improve query peformance - could you mention the respective page numbers in the 2 books, since many in this forum may have access to them?
But, regardless of whether you use Reference dimensions, or roll Client, Employee and Product into the Portfolio dimension, there should be no need to denormalize the snowflake to a star. For example, the Product dimension in Adventure Works has 3 tables, but there are other examples of Reference dimensions as well.
Monday, February 20, 2012
Re-do replication for new release
We alter the database schema that our production application uses with almost every release. Is there a way to basically remove the replication and re-do it for all tables / views at one time? Then we could just "rebuild" the replication with every release. We have about 200 tables and 200 views that have many dependencies. I'm sure it could be done with scripting and the stored procedures, but I'm new at this and not sure where to start. Any ideas? Thanks!
Yes, you could script out all the replication settings (publication, articles, jobs, subscriptions, etc) using the UI, then remove replication completely from the publisher as well as subscriber and after you do the schema changes to the databases, then use the scripts to setup replication again on the new release.But however note that there are always differences between releases. There could be slight differences in the way they are scripted out and the way they are handled in the new release. With that in mind, you may have to slightly edit the scripts before running them on the newest version.
Also, I would first test it out on a test systems before trying it on the production servers.
Also note that With SQL Server 2005, schema changes to the tables are replicated to the subscriber. So for example, if you add a new column to one of the replicated tables, that new column will be replicated to the Subscriber when configured appropriately.|||Thank you Sir, for your suggestions. I will give them a try.