The query:
Select FirstName, LastName
from AdventureWorks.Person.Contact PC
, AdventureWorks.HumanResources.Employee HRE
Where PC.ContactId = HRE.ContactId
AND LastName like 'Gilbert'
FOR XML auto, xmldata
The results:
<?xml version="1.0" encoding="UTF-8"?>
<Schema name="Schema1" xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="PC" content="empty" model="closed">
<AttributeType name="FirstName" dt:type="string" />
<AttributeType name="LastName" dt:type="string" />
<attribute type="FirstName" />
<attribute type="LastName" />
</ElementType>
</Schema>
<PC xmlns="x-schema:#Schema1" FirstName="Guy" LastName="Gilbert" />
Action:
Paste results into Altova XML Spy xml schema file type
or sml document file type
The Error:
File not well formatted.It seems to be two document elements issue.
Pohwan Han. Seoul. Have a nice day.
"mj" <mj@.discussions.microsoft.com> wrote in message
news:D479F5A7-235B-46D7-9E63-DA99F19964B1@.microsoft.com...
> The query:
> Select FirstName, LastName
> from AdventureWorks.Person.Contact PC
> , AdventureWorks.HumanResources.Employee HRE
> Where PC.ContactId = HRE.ContactId
> AND LastName like 'Gilbert'
> FOR XML auto, xmldata
> The results:
> <?xml version="1.0" encoding="UTF-8"?>
>
> <Schema name="Schema1" xmlns="urn:schemas-microsoft-com:xml-data"
> xmlns:dt="urn:schemas-microsoft-com:datatypes">
> <ElementType name="PC" content="empty" model="closed">
> <AttributeType name="FirstName" dt:type="string" />
> <AttributeType name="LastName" dt:type="string" />
> <attribute type="FirstName" />
> <attribute type="LastName" />
> </ElementType>
> </Schema>
> <PC xmlns="x-schema:#Schema1" FirstName="Guy" LastName="Gilbert" />
> Action:
> Paste results into Altova XML Spy xml schema file type
> or sml document file type
> The Error:
> File not well formatted.
>
>|||Woud it be possible to expand a littleon you're response please?
"Han" wrote:
> It seems to be two document elements issue.
> --
> Pohwan Han. Seoul. Have a nice day.
> "mj" <mj@.discussions.microsoft.com> wrote in message
> news:D479F5A7-235B-46D7-9E63-DA99F19964B1@.microsoft.com...
>|||A FOR XML query returns fragments and not whole documents. You may want to
specify the root property in the provider to get the document well formed
with a single root element.
Best regards
Michael
"mj" <mj@.discussions.microsoft.com> wrote in message
news:945BDD2C-918B-4D0E-A6E2-709A6190D32B@.microsoft.com...
> Woud it be possible to expand a littleon you're response please?
> "Han" wrote:
>
Showing posts with label adventureworks. Show all posts
Showing posts with label adventureworks. Show all posts
Monday, March 26, 2012
newbie question
Labels:
adventureworks,
contact,
contactid,
database,
employee,
firstname,
hrewhere,
humanresources,
lastnamefrom,
microsoft,
mysql,
newbie,
oracle,
queryselect,
server,
sql
newbie question
The query:
Select FirstName, LastName
from AdventureWorks.Person.Contact PC
, AdventureWorks.HumanResources.Employee HRE
Where PC.ContactId = HRE.ContactId
AND LastName like 'Gilbert'
FOR XML auto, xmldata
The results:
<?xml version="1.0" encoding="UTF-8"?>
<Schema name="Schema1" xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="PC" content="empty" model="closed">
<AttributeType name="FirstName" dt:type="string" />
<AttributeType name="LastName" dt:type="string" />
<attribute type="FirstName" />
<attribute type="LastName" />
</ElementType>
</Schema>
<PC xmlns="x-schema:#Schema1" FirstName="Guy" LastName="Gilbert" />
Action:
Paste results into Altova XML Spy xml schema file type
or sml document file type
The Error:
File not well formatted.
It seems to be two document elements issue.
Pohwan Han. Seoul. Have a nice day.
"mj" <mj@.discussions.microsoft.com> wrote in message
news:D479F5A7-235B-46D7-9E63-DA99F19964B1@.microsoft.com...
> The query:
> Select FirstName, LastName
> from AdventureWorks.Person.Contact PC
> , AdventureWorks.HumanResources.Employee HRE
> Where PC.ContactId = HRE.ContactId
> AND LastName like 'Gilbert'
> FOR XML auto, xmldata
> The results:
> <?xml version="1.0" encoding="UTF-8"?>
>
> <Schema name="Schema1" xmlns="urn:schemas-microsoft-com:xml-data"
> xmlns:dt="urn:schemas-microsoft-com:datatypes">
> <ElementType name="PC" content="empty" model="closed">
> <AttributeType name="FirstName" dt:type="string" />
> <AttributeType name="LastName" dt:type="string" />
> <attribute type="FirstName" />
> <attribute type="LastName" />
> </ElementType>
> </Schema>
> <PC xmlns="x-schema:#Schema1" FirstName="Guy" LastName="Gilbert" />
> Action:
> Paste results into Altova XML Spy xml schema file type
> or sml document file type
> The Error:
> File not well formatted.
>
>
|||Woud it be possible to expand a littleon you're response please?
"Han" wrote:
> It seems to be two document elements issue.
> --
> Pohwan Han. Seoul. Have a nice day.
> "mj" <mj@.discussions.microsoft.com> wrote in message
> news:D479F5A7-235B-46D7-9E63-DA99F19964B1@.microsoft.com...
>
|||A FOR XML query returns fragments and not whole documents. You may want to
specify the root property in the provider to get the document well formed
with a single root element.
Best regards
Michael
"mj" <mj@.discussions.microsoft.com> wrote in message
news:945BDD2C-918B-4D0E-A6E2-709A6190D32B@.microsoft.com...[vbcol=seagreen]
> Woud it be possible to expand a littleon you're response please?
> "Han" wrote:
Select FirstName, LastName
from AdventureWorks.Person.Contact PC
, AdventureWorks.HumanResources.Employee HRE
Where PC.ContactId = HRE.ContactId
AND LastName like 'Gilbert'
FOR XML auto, xmldata
The results:
<?xml version="1.0" encoding="UTF-8"?>
<Schema name="Schema1" xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="PC" content="empty" model="closed">
<AttributeType name="FirstName" dt:type="string" />
<AttributeType name="LastName" dt:type="string" />
<attribute type="FirstName" />
<attribute type="LastName" />
</ElementType>
</Schema>
<PC xmlns="x-schema:#Schema1" FirstName="Guy" LastName="Gilbert" />
Action:
Paste results into Altova XML Spy xml schema file type
or sml document file type
The Error:
File not well formatted.
It seems to be two document elements issue.
Pohwan Han. Seoul. Have a nice day.
"mj" <mj@.discussions.microsoft.com> wrote in message
news:D479F5A7-235B-46D7-9E63-DA99F19964B1@.microsoft.com...
> The query:
> Select FirstName, LastName
> from AdventureWorks.Person.Contact PC
> , AdventureWorks.HumanResources.Employee HRE
> Where PC.ContactId = HRE.ContactId
> AND LastName like 'Gilbert'
> FOR XML auto, xmldata
> The results:
> <?xml version="1.0" encoding="UTF-8"?>
>
> <Schema name="Schema1" xmlns="urn:schemas-microsoft-com:xml-data"
> xmlns:dt="urn:schemas-microsoft-com:datatypes">
> <ElementType name="PC" content="empty" model="closed">
> <AttributeType name="FirstName" dt:type="string" />
> <AttributeType name="LastName" dt:type="string" />
> <attribute type="FirstName" />
> <attribute type="LastName" />
> </ElementType>
> </Schema>
> <PC xmlns="x-schema:#Schema1" FirstName="Guy" LastName="Gilbert" />
> Action:
> Paste results into Altova XML Spy xml schema file type
> or sml document file type
> The Error:
> File not well formatted.
>
>
|||Woud it be possible to expand a littleon you're response please?
"Han" wrote:
> It seems to be two document elements issue.
> --
> Pohwan Han. Seoul. Have a nice day.
> "mj" <mj@.discussions.microsoft.com> wrote in message
> news:D479F5A7-235B-46D7-9E63-DA99F19964B1@.microsoft.com...
>
|||A FOR XML query returns fragments and not whole documents. You may want to
specify the root property in the provider to get the document well formed
with a single root element.
Best regards
Michael
"mj" <mj@.discussions.microsoft.com> wrote in message
news:945BDD2C-918B-4D0E-A6E2-709A6190D32B@.microsoft.com...[vbcol=seagreen]
> Woud it be possible to expand a littleon you're response please?
> "Han" wrote:
Labels:
adventureworks,
contact,
contactid,
database,
employee,
firstname,
hrewhere,
humanresources,
lastnamefrom,
microsoft,
mysql,
newbie,
oracle,
queryselect,
server,
sql
Monday, March 19, 2012
Newbie needs help
Hi,
I am using SQLEXPRESS running locally on my machine and am trying to create
a database (AdventureWorks) for an example that I am using. What complicates
this a bit is that this example is using NAnt. The local.properties.xml file
contains the following:
<?xml version="1.0"?>
<properties>
<property name="sqlToolsFolder" value="C:\Program Files\Microsoft SQL
Server\90\Tools\Binn"/>
<property name="osql.ConnectionString" value="-E"/>
<property name="initial.catalog" value="AdventureWorks"/>
<property name="config.ConnectionString" value="data
source=SQLEXPRESS;Integrated Security=SSPI;Initial
Catalog=${initial.catalog}"/> <property name="database.path"
value="C:\root\development\databases" />
<property name="osql.exe" value="${sqlToolsFolder}\osql.exe" />
</properties>
When I open the Enterprise Manager and run the script for attach.sql the
database is created fine.
when I run the "build builddb" I get the following error:
NAnt 0.85 (Build 0.85.2139.0; nightly; 11/9/2005)
Copyright (C) 2001-2005 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///C:/root/development/playground/adventureworks/avworks.bui
ld
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: builddb
[echo] Loading local.properties.xml
builddb:
exec.sql.template:
convert.template:
[copy] Copying 1 file to
'C:\root\development\playground\adventur
eworks\sql
\attach.sql'.
[exec] Msg 1813, Level 16, State 2, Server OHBOCXX99RMRVK, Line 1
[exec] Could not open new database 'AdventureWorks'. CREATE DATABASE is
aborted.
[exec] Msg 602, Level 21, State 50, Server OHBOCXX99RMRVK, Line 1
[exec] Could not find row in sysindexes for database ID 13, object ID
1, in
dex ID 1.
[exec] Run DBCC CHECKTABLE on sysindexes.
BUILD FAILED
C:\root\development\playground\adventure
works\avworks.build(60,10):
External Program Failed: C:\Program Files\Microsoft SQL
Server\90\Tools\Binn\osq
l.exe (return code was 1)
Total time: 1.8 seconds.
When I installed SQLEXPRESS, I installed it using Windows Authentication and
I would think that Integrated Security would work. I'll bet I'm doing
something silly, but I've tried to figure it out with no luck.
thanks in advance!
BillChances are they are using the AdventureWorks sample database which come
populated with a bunch of sample data. You can download it here:
http://www.microsoft.com/downloads/...&displaylang=en
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Bill44077" <Bill44077@.discussions.microsoft.com> wrote in message
news:A1B3826A-0D0F-4B1F-804A-DB222842D778@.microsoft.com...
> Hi,
> I am using SQLEXPRESS running locally on my machine and am trying to
> create
> a database (AdventureWorks) for an example that I am using. What
> complicates
> this a bit is that this example is using NAnt. The local.properties.xml
> file
> contains the following:
> <?xml version="1.0"?>
> <properties>
> <property name="sqlToolsFolder" value="C:\Program Files\Microsoft SQL
> Server\90\Tools\Binn"/>
> <property name="osql.ConnectionString" value="-E"/>
> <property name="initial.catalog" value="AdventureWorks"/>
> <property name="config.ConnectionString" value="data
> source=SQLEXPRESS;Integrated Security=SSPI;Initial
> Catalog=${initial.catalog}"/> <property name="database.path"
> value="C:\root\development\databases" />
> <property name="osql.exe" value="${sqlToolsFolder}\osql.exe" />
> </properties>
> When I open the Enterprise Manager and run the script for attach.sql the
> database is created fine.
> when I run the "build builddb" I get the following error:
> NAnt 0.85 (Build 0.85.2139.0; nightly; 11/9/2005)
> Copyright (C) 2001-2005 Gerry Shaw
> http://nant.sourceforge.net
> Buildfile:
> file:///C:/root/development/playground/adventureworks/avworks.build
> Target framework: Microsoft .NET Framework 2.0
> Target(s) specified: builddb
> [echo] Loading local.properties.xml
> builddb:
>
> exec.sql.template:
>
> convert.template:
> [copy] Copying 1 file to
> 'C:\root\development\playground\adventur
eworks\sql
> \attach.sql'.
> [exec] Msg 1813, Level 16, State 2, Server OHBOCXX99RMRVK, Line 1
> [exec] Could not open new database 'AdventureWorks'. CREATE DATABA
SE
> is
> aborted.
> [exec] Msg 602, Level 21, State 50, Server OHBOCXX99RMRVK, Line 1
> [exec] Could not find row in sysindexes for database ID 13, object
ID
> 1, in
> dex ID 1.
> [exec] Run DBCC CHECKTABLE on sysindexes.
> BUILD FAILED
> C:\root\development\playground\adventure
works\avworks.build(60,10):
> External Program Failed: C:\Program Files\Microsoft SQL
> Server\90\Tools\Binn\osq
> l.exe (return code was 1)
> Total time: 1.8 seconds.
> When I installed SQLEXPRESS, I installed it using Windows Authentication
> and
> I would think that Integrated Security would work. I'll bet I'm doing
> something silly, but I've tried to figure it out with no luck.
> thanks in advance!
> Bill
I am using SQLEXPRESS running locally on my machine and am trying to create
a database (AdventureWorks) for an example that I am using. What complicates
this a bit is that this example is using NAnt. The local.properties.xml file
contains the following:
<?xml version="1.0"?>
<properties>
<property name="sqlToolsFolder" value="C:\Program Files\Microsoft SQL
Server\90\Tools\Binn"/>
<property name="osql.ConnectionString" value="-E"/>
<property name="initial.catalog" value="AdventureWorks"/>
<property name="config.ConnectionString" value="data
source=SQLEXPRESS;Integrated Security=SSPI;Initial
Catalog=${initial.catalog}"/> <property name="database.path"
value="C:\root\development\databases" />
<property name="osql.exe" value="${sqlToolsFolder}\osql.exe" />
</properties>
When I open the Enterprise Manager and run the script for attach.sql the
database is created fine.
when I run the "build builddb" I get the following error:
NAnt 0.85 (Build 0.85.2139.0; nightly; 11/9/2005)
Copyright (C) 2001-2005 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///C:/root/development/playground/adventureworks/avworks.bui
ld
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: builddb
[echo] Loading local.properties.xml
builddb:
exec.sql.template:
convert.template:
[copy] Copying 1 file to
'C:\root\development\playground\adventur
eworks\sql
\attach.sql'.
[exec] Msg 1813, Level 16, State 2, Server OHBOCXX99RMRVK, Line 1
[exec] Could not open new database 'AdventureWorks'. CREATE DATABASE is
aborted.
[exec] Msg 602, Level 21, State 50, Server OHBOCXX99RMRVK, Line 1
[exec] Could not find row in sysindexes for database ID 13, object ID
1, in
dex ID 1.
[exec] Run DBCC CHECKTABLE on sysindexes.
BUILD FAILED
C:\root\development\playground\adventure
works\avworks.build(60,10):
External Program Failed: C:\Program Files\Microsoft SQL
Server\90\Tools\Binn\osq
l.exe (return code was 1)
Total time: 1.8 seconds.
When I installed SQLEXPRESS, I installed it using Windows Authentication and
I would think that Integrated Security would work. I'll bet I'm doing
something silly, but I've tried to figure it out with no luck.
thanks in advance!
BillChances are they are using the AdventureWorks sample database which come
populated with a bunch of sample data. You can download it here:
http://www.microsoft.com/downloads/...&displaylang=en
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Bill44077" <Bill44077@.discussions.microsoft.com> wrote in message
news:A1B3826A-0D0F-4B1F-804A-DB222842D778@.microsoft.com...
> Hi,
> I am using SQLEXPRESS running locally on my machine and am trying to
> create
> a database (AdventureWorks) for an example that I am using. What
> complicates
> this a bit is that this example is using NAnt. The local.properties.xml
> file
> contains the following:
> <?xml version="1.0"?>
> <properties>
> <property name="sqlToolsFolder" value="C:\Program Files\Microsoft SQL
> Server\90\Tools\Binn"/>
> <property name="osql.ConnectionString" value="-E"/>
> <property name="initial.catalog" value="AdventureWorks"/>
> <property name="config.ConnectionString" value="data
> source=SQLEXPRESS;Integrated Security=SSPI;Initial
> Catalog=${initial.catalog}"/> <property name="database.path"
> value="C:\root\development\databases" />
> <property name="osql.exe" value="${sqlToolsFolder}\osql.exe" />
> </properties>
> When I open the Enterprise Manager and run the script for attach.sql the
> database is created fine.
> when I run the "build builddb" I get the following error:
> NAnt 0.85 (Build 0.85.2139.0; nightly; 11/9/2005)
> Copyright (C) 2001-2005 Gerry Shaw
> http://nant.sourceforge.net
> Buildfile:
> file:///C:/root/development/playground/adventureworks/avworks.build
> Target framework: Microsoft .NET Framework 2.0
> Target(s) specified: builddb
> [echo] Loading local.properties.xml
> builddb:
>
> exec.sql.template:
>
> convert.template:
> [copy] Copying 1 file to
> 'C:\root\development\playground\adventur
eworks\sql
> \attach.sql'.
> [exec] Msg 1813, Level 16, State 2, Server OHBOCXX99RMRVK, Line 1
> [exec] Could not open new database 'AdventureWorks'. CREATE DATABA
SE
> is
> aborted.
> [exec] Msg 602, Level 21, State 50, Server OHBOCXX99RMRVK, Line 1
> [exec] Could not find row in sysindexes for database ID 13, object
ID
> 1, in
> dex ID 1.
> [exec] Run DBCC CHECKTABLE on sysindexes.
> BUILD FAILED
> C:\root\development\playground\adventure
works\avworks.build(60,10):
> External Program Failed: C:\Program Files\Microsoft SQL
> Server\90\Tools\Binn\osq
> l.exe (return code was 1)
> Total time: 1.8 seconds.
> When I installed SQLEXPRESS, I installed it using Windows Authentication
> and
> I would think that Integrated Security would work. I'll bet I'm doing
> something silly, but I've tried to figure it out with no luck.
> thanks in advance!
> Bill
Subscribe to:
Posts (Atom)