Dear all,
While
DECLARE @.x xml
SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
SELECT (select @.x).query('//a')
works fine, a very similar query
DECLARE @.x xml
SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
SELECT t.c.query('.') from (select @.x).nodes('//a') t(c)
fails with
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '.'.
Anyone knows whether this is expected/documented behaviour?
Thanks
PeterDerived table syntax in FROM clause requires table alias to follow it
(unlike scalar sub-query in SELECT).
You can achieve what you want with CROSS APPLY:
DECLARE @.x xml
SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
SELECT t2.c.query('.') from (select @.x) t1(x) CROSS APPLY t1.x.nodes('//a')
t2(c)
Best regards,
Eugene
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter" <pgp.coppens@.gmail.com> wrote in message
news:1138820267.235233.39270@.f14g2000cwb.googlegroups.com...
> Dear all,
> While
> DECLARE @.x xml
> SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
> SELECT (select @.x).query('//a')
> works fine, a very similar query
> DECLARE @.x xml
> SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
> SELECT t.c.query('.') from (select @.x).nodes('//a') t(c)
> fails with
> Msg 102, Level 15, State 1, Line 3
> Incorrect syntax near '.'.
> Anyone knows whether this is expected/documented behaviour?
> Thanks
> Peter
>|||That helps,
Thanks,
Peter.
Showing posts with label nodes. Show all posts
Showing posts with label nodes. Show all posts
Wednesday, March 7, 2012
nodes does not seem to work when xml value is created through a select
Dear all,
While
DECLARE @.x xml
SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
SELECT (select @.x).query('//a')
works fine, a very similar query
DECLARE @.x xml
SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
SELECT t.c.query('.') from (select @.x).nodes('//a') t(c)
fails with
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '.'.
Anyone knows whether this is expected/documented behaviour?
Thanks
Peter
Derived table syntax in FROM clause requires table alias to follow it
(unlike scalar sub-query in SELECT).
You can achieve what you want with CROSS APPLY:
DECLARE @.x xml
SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
SELECT t2.c.query('.') from (select @.x) t1(x) CROSS APPLY t1.x.nodes('//a')
t2(c)
Best regards,
Eugene
This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter" <pgp.coppens@.gmail.com> wrote in message
news:1138820267.235233.39270@.f14g2000cwb.googlegro ups.com...
> Dear all,
> While
> DECLARE @.x xml
> SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
> SELECT (select @.x).query('//a')
> works fine, a very similar query
> DECLARE @.x xml
> SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
> SELECT t.c.query('.') from (select @.x).nodes('//a') t(c)
> fails with
> Msg 102, Level 15, State 1, Line 3
> Incorrect syntax near '.'.
> Anyone knows whether this is expected/documented behaviour?
> Thanks
> Peter
>
|||That helps,
Thanks,
Peter.
While
DECLARE @.x xml
SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
SELECT (select @.x).query('//a')
works fine, a very similar query
DECLARE @.x xml
SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
SELECT t.c.query('.') from (select @.x).nodes('//a') t(c)
fails with
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '.'.
Anyone knows whether this is expected/documented behaviour?
Thanks
Peter
Derived table syntax in FROM clause requires table alias to follow it
(unlike scalar sub-query in SELECT).
You can achieve what you want with CROSS APPLY:
DECLARE @.x xml
SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
SELECT t2.c.query('.') from (select @.x) t1(x) CROSS APPLY t1.x.nodes('//a')
t2(c)
Best regards,
Eugene
This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter" <pgp.coppens@.gmail.com> wrote in message
news:1138820267.235233.39270@.f14g2000cwb.googlegro ups.com...
> Dear all,
> While
> DECLARE @.x xml
> SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
> SELECT (select @.x).query('//a')
> works fine, a very similar query
> DECLARE @.x xml
> SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
> SELECT t.c.query('.') from (select @.x).nodes('//a') t(c)
> fails with
> Msg 102, Level 15, State 1, Line 3
> Incorrect syntax near '.'.
> Anyone knows whether this is expected/documented behaviour?
> Thanks
> Peter
>
|||That helps,
Thanks,
Peter.
Node Cluster - Fails on Network Resources
I am running a 2-node cluster for SQL Server. After powering down both
servers (passive then active), one of the nodes did not successfully join the
cluster. This node shows exclamation marks on the Network Interfaces in
Cluster Administrator. These nics are functioning correctly outside of the
cluster. The cluster log on the failed node indicates that these network
interfaces are functioning each time it tries to join the cluster. The
active node's cluster log indicates that these resources are not functioning
and removes the other node from being active.
If anyone has any ideas on how to solve this problem, your input would be
greatly appreciated.
Thanks,
Debbie
Is the NIC you have exclamation mark on Public or Private network?
Ayad
"Debbie" <Debbie@.discussions.microsoft.com> wrote in message
news:1CC9F5E6-46E3-482A-913C-B8C57692BDB2@.microsoft.com...
> I am running a 2-node cluster for SQL Server. After powering down both
> servers (passive then active), one of the nodes did not successfully join
the
> cluster. This node shows exclamation marks on the Network Interfaces in
> Cluster Administrator. These nics are functioning correctly outside of
the
> cluster. The cluster log on the failed node indicates that these network
> interfaces are functioning each time it tries to join the cluster. The
> active node's cluster log indicates that these resources are not
functioning
> and removes the other node from being active.
> If anyone has any ideas on how to solve this problem, your input would be
> greatly appreciated.
> Thanks,
> Debbie
>
|||There are three NICs, the heartbeat (crossover), private (for backups) and
our intranet. All three have the exclamation mark.
"Ayad" wrote:
> Is the NIC you have exclamation mark on Public or Private network?
> Ayad
> "Debbie" <Debbie@.discussions.microsoft.com> wrote in message
> news:1CC9F5E6-46E3-482A-913C-B8C57692BDB2@.microsoft.com...
> the
> the
> functioning
>
>
|||Check your IP settings and make sure you are using the correct subnet mask
address and network segment for each port and match each port with the other
node's port.
Was it working before or this is a new install?
Ayad
"Debbie" <Debbie@.discussions.microsoft.com> wrote in message
news:89B546EC-247D-464E-A149-6952D4AC5EC7@.microsoft.com...[vbcol=seagreen]
> There are three NICs, the heartbeat (crossover), private (for backups) and
> our intranet. All three have the exclamation mark.
> "Ayad" wrote:
join[vbcol=seagreen]
in[vbcol=seagreen]
of[vbcol=seagreen]
network[vbcol=seagreen]
The[vbcol=seagreen]
be[vbcol=seagreen]
|||Ayad,
This is not a new install. It was working before. We had to power down all
of the servers for a generator hook-up to be installed. When bringing the
cluster back up, this server failed and has failed ever since with these NIC
resource errors.
The subnets look good on the NICs.
Thanks,
Debbie
"Ayad" wrote:
> Check your IP settings and make sure you are using the correct subnet mask
> address and network segment for each port and match each port with the other
> node's port.
> Was it working before or this is a new install?
> Ayad
> "Debbie" <Debbie@.discussions.microsoft.com> wrote in message
> news:89B546EC-247D-464E-A149-6952D4AC5EC7@.microsoft.com...
> join
> in
> of
> network
> The
> be
>
>
|||Debbie,
Try Shutdown that node (server hard reboot) and power it ON again and see if
it clears your NIC issue.
Ayad
"Debbie" <Debbie@.discussions.microsoft.com> wrote in message
news:9AA7AFAC-5A77-4A71-B901-9CB4E99462ED@.microsoft.com...
> Ayad,
> This is not a new install. It was working before. We had to power down
all
> of the servers for a generator hook-up to be installed. When bringing the
> cluster back up, this server failed and has failed ever since with these
NIC[vbcol=seagreen]
> resource errors.
> The subnets look good on the NICs.
> Thanks,
> Debbie
> "Ayad" wrote:
mask[vbcol=seagreen]
other[vbcol=seagreen]
and[vbcol=seagreen]
both[vbcol=seagreen]
successfully[vbcol=seagreen]
Interfaces[vbcol=seagreen]
outside[vbcol=seagreen]
would[vbcol=seagreen]
|||Ayad,
The hard reboot did not clear up the problem. I am thinking of removing
this node from the cluster and then readding it to the cluster to see if that
clears up the problem.
Thanks,
Debbie
"Ayad" wrote:
> Debbie,
> Try Shutdown that node (server hard reboot) and power it ON again and see if
> it clears your NIC issue.
> Ayad
> "Debbie" <Debbie@.discussions.microsoft.com> wrote in message
> news:9AA7AFAC-5A77-4A71-B901-9CB4E99462ED@.microsoft.com...
> all
> NIC
> mask
> other
> and
> both
> successfully
> Interfaces
> outside
> would
>
>
servers (passive then active), one of the nodes did not successfully join the
cluster. This node shows exclamation marks on the Network Interfaces in
Cluster Administrator. These nics are functioning correctly outside of the
cluster. The cluster log on the failed node indicates that these network
interfaces are functioning each time it tries to join the cluster. The
active node's cluster log indicates that these resources are not functioning
and removes the other node from being active.
If anyone has any ideas on how to solve this problem, your input would be
greatly appreciated.
Thanks,
Debbie
Is the NIC you have exclamation mark on Public or Private network?
Ayad
"Debbie" <Debbie@.discussions.microsoft.com> wrote in message
news:1CC9F5E6-46E3-482A-913C-B8C57692BDB2@.microsoft.com...
> I am running a 2-node cluster for SQL Server. After powering down both
> servers (passive then active), one of the nodes did not successfully join
the
> cluster. This node shows exclamation marks on the Network Interfaces in
> Cluster Administrator. These nics are functioning correctly outside of
the
> cluster. The cluster log on the failed node indicates that these network
> interfaces are functioning each time it tries to join the cluster. The
> active node's cluster log indicates that these resources are not
functioning
> and removes the other node from being active.
> If anyone has any ideas on how to solve this problem, your input would be
> greatly appreciated.
> Thanks,
> Debbie
>
|||There are three NICs, the heartbeat (crossover), private (for backups) and
our intranet. All three have the exclamation mark.
"Ayad" wrote:
> Is the NIC you have exclamation mark on Public or Private network?
> Ayad
> "Debbie" <Debbie@.discussions.microsoft.com> wrote in message
> news:1CC9F5E6-46E3-482A-913C-B8C57692BDB2@.microsoft.com...
> the
> the
> functioning
>
>
|||Check your IP settings and make sure you are using the correct subnet mask
address and network segment for each port and match each port with the other
node's port.
Was it working before or this is a new install?
Ayad
"Debbie" <Debbie@.discussions.microsoft.com> wrote in message
news:89B546EC-247D-464E-A149-6952D4AC5EC7@.microsoft.com...[vbcol=seagreen]
> There are three NICs, the heartbeat (crossover), private (for backups) and
> our intranet. All three have the exclamation mark.
> "Ayad" wrote:
join[vbcol=seagreen]
in[vbcol=seagreen]
of[vbcol=seagreen]
network[vbcol=seagreen]
The[vbcol=seagreen]
be[vbcol=seagreen]
|||Ayad,
This is not a new install. It was working before. We had to power down all
of the servers for a generator hook-up to be installed. When bringing the
cluster back up, this server failed and has failed ever since with these NIC
resource errors.
The subnets look good on the NICs.
Thanks,
Debbie
"Ayad" wrote:
> Check your IP settings and make sure you are using the correct subnet mask
> address and network segment for each port and match each port with the other
> node's port.
> Was it working before or this is a new install?
> Ayad
> "Debbie" <Debbie@.discussions.microsoft.com> wrote in message
> news:89B546EC-247D-464E-A149-6952D4AC5EC7@.microsoft.com...
> join
> in
> of
> network
> The
> be
>
>
|||Debbie,
Try Shutdown that node (server hard reboot) and power it ON again and see if
it clears your NIC issue.
Ayad
"Debbie" <Debbie@.discussions.microsoft.com> wrote in message
news:9AA7AFAC-5A77-4A71-B901-9CB4E99462ED@.microsoft.com...
> Ayad,
> This is not a new install. It was working before. We had to power down
all
> of the servers for a generator hook-up to be installed. When bringing the
> cluster back up, this server failed and has failed ever since with these
NIC[vbcol=seagreen]
> resource errors.
> The subnets look good on the NICs.
> Thanks,
> Debbie
> "Ayad" wrote:
mask[vbcol=seagreen]
other[vbcol=seagreen]
and[vbcol=seagreen]
both[vbcol=seagreen]
successfully[vbcol=seagreen]
Interfaces[vbcol=seagreen]
outside[vbcol=seagreen]
would[vbcol=seagreen]
|||Ayad,
The hard reboot did not clear up the problem. I am thinking of removing
this node from the cluster and then readding it to the cluster to see if that
clears up the problem.
Thanks,
Debbie
"Ayad" wrote:
> Debbie,
> Try Shutdown that node (server hard reboot) and power it ON again and see if
> it clears your NIC issue.
> Ayad
> "Debbie" <Debbie@.discussions.microsoft.com> wrote in message
> news:9AA7AFAC-5A77-4A71-B901-9CB4E99462ED@.microsoft.com...
> all
> NIC
> mask
> other
> and
> both
> successfully
> Interfaces
> outside
> would
>
>
Subscribe to:
Posts (Atom)