SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 xml quesiton
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

basicconfiguration
Constraint Violating Yak Guru

350 Posts

Posted - 05/31/2012 :  20:30:30  Show Profile  Reply with Quote
select top 2 Ad.AdAttributes.value('(//attribute[@id=52]/item/@value)[1]','VARCHAR(400)')
,* from ad

select top 2 Ad.AdAttributes.value('(//attribute[@id=52]/item/@value)[1]','VARCHAR(400)')
from ad
any ideas why i get values in the first select statement but not in the 2nd statement?
I know in the first statement i have the *. but why does that matter?

Edited by - basicconfiguration on 05/31/2012 20:31:03

visakh16
Very Important crosS Applying yaK Herder

India
47157 Posts

Posted - 05/31/2012 :  20:44:51  Show Profile  Reply with Quote
whats the xml you're trying to apply this code on?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

basicconfiguration
Constraint Violating Yak Guru

350 Posts

Posted - 06/01/2012 :  18:41:41  Show Profile  Reply with Quote
<mix mixID="21">
<attributes>


<attribute id="52" name="Property Description">
<item value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
</attribute>


</attributes>
</mix>
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47157 Posts

Posted - 06/02/2012 :  00:31:44  Show Profile  Reply with Quote
will you've only one node with id 52 always?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

basicconfiguration
Constraint Violating Yak Guru

350 Posts

Posted - 06/11/2012 :  19:32:25  Show Profile  Reply with Quote
I fixed this one. thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47157 Posts

Posted - 06/11/2012 :  19:44:06  Show Profile  Reply with Quote
wc

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000