Click here to Skip to main content
15,908,675 members
Home / Discussions / Database
   

Database

 
GeneralRe: Music Database?? [modified] Pin
Andy_L_J13-Feb-10 9:34
Andy_L_J13-Feb-10 9:34 
GeneralRe: Music Database?? Pin
thatraja13-Feb-10 17:40
professionalthatraja13-Feb-10 17:40 
GeneralRe: Music Database?? Pin
AmbiguousName13-Feb-10 20:41
AmbiguousName13-Feb-10 20:41 
GeneralRe: Music Database?? Pin
Andy_L_J13-Feb-10 20:50
Andy_L_J13-Feb-10 20:50 
AnswerRe: Music Database?? Pin
dan!sh 13-Feb-10 2:32
professional dan!sh 13-Feb-10 2:32 
Questionsearch on xml field in table of sql server? Pin
Tridip Bhattacharjee11-Feb-10 21:38
professionalTridip Bhattacharjee11-Feb-10 21:38 
AnswerRe: search on xml field in table of sql server? Pin
Pranay Rana12-Feb-10 1:35
professionalPranay Rana12-Feb-10 1:35 
AnswerRe: search on xml field in table of sql server? Pin
Eddy Vluggen12-Feb-10 1:37
professionalEddy Vluggen12-Feb-10 1:37 
Tridip Bhattacharjee wrote:
how to query address field in my xml or how to query Options field,how query CompanyOrName.



A XML-query will look somewhat more complicated then a "regular" query. I hope that the example below provides a good impression of the used construct;
SQL
DECLARE @ShipXML XML
    SET @ShipXML = 
	'<OpenShipments>
		<OpenShipment>
			<NumberOfPackages>1</NumberOfPackages>
			<ShipmentActualWeight>5</ShipmentActualWeight>
			<DescriptionOfGoods>Car Parts</DescriptionOfGoods>
		</OpenShipment>
		<OpenShipment>
			<NumberOfPackages>2</NumberOfPackages>
			<ShipmentActualWeight>3</ShipmentActualWeight>
			<DescriptionOfGoods>Bike Parts</DescriptionOfGoods>
		</OpenShipment>
	</OpenShipments>'

SELECT shs.sh.value('NumberOfPackages[1]','bigint') AS NumberOfPackages
      ,shs.sh.value('ShipmentActualWeight[1]','bigint') AS ShipmentActualWeight
      ,shs.sh.value('DescriptionOfGoods[1]','varchar(20)') AS DescriptionOfGoods
  FROM @ShipXML.nodes('OpenShipments/OpenShipment') shs(sh)
 WHERE shs.sh.exist('.[DescriptionOfGoods != "Car Parts"]') = 1
The example was built using sample-code from MSDN[^].
I are Troll Suspicious | :suss:

QuestionBest Approach - Crystal To Excel Pin
bdaoust11-Feb-10 12:20
bdaoust11-Feb-10 12:20 
AnswerRe: Best Approach - Crystal To Excel Pin
Mycroft Holmes11-Feb-10 15:15
professionalMycroft Holmes11-Feb-10 15:15 
QuestionError establishing a relation in access database through sql statement Pin
A&Ms11-Feb-10 9:19
A&Ms11-Feb-10 9:19 
QuestionMsAccess Query problem Pin
vishnukamath10-Feb-10 20:38
vishnukamath10-Feb-10 20:38 
AnswerRe: MsAccess Query problem Pin
Mycroft Holmes10-Feb-10 23:36
professionalMycroft Holmes10-Feb-10 23:36 
QuestionProblem with Distinct and Order By when querying csv with .NET System::Data::OleDb::OleDbConnection [modified] Pin
T21029-Feb-10 22:40
T21029-Feb-10 22:40 
AnswerRe: Problem with Distinct and Order By when querying csv with .NET System::Data::OleDb::OleDbConnection Pin
dan!sh 10-Feb-10 2:57
professional dan!sh 10-Feb-10 2:57 
GeneralRe: Problem with Distinct and Order By when querying csv with .NET System::Data::OleDb::OleDbConnection Pin
T210210-Feb-10 12:43
T210210-Feb-10 12:43 
QuestionRestrict showdialog only to the parent window ? [modified] Pin
fracalifa9-Feb-10 21:27
fracalifa9-Feb-10 21:27 
AnswerRe: Restrict showdialog only to the parent window ? Pin
J4amieC9-Feb-10 21:45
J4amieC9-Feb-10 21:45 
GeneralRe: Restrict showdialog only to the parent window ? Pin
fracalifa9-Feb-10 21:48
fracalifa9-Feb-10 21:48 
QuestionDB Backup Sql query Pin
Sivaooty9-Feb-10 19:58
Sivaooty9-Feb-10 19:58 
AnswerRe: DB Backup Sql query Pin
Md. Marufuzzaman10-Feb-10 3:54
professionalMd. Marufuzzaman10-Feb-10 3:54 
QuestionHelp with this SQl Logic without using UDF Pin
Vimalsoft(Pty) Ltd9-Feb-10 4:14
professionalVimalsoft(Pty) Ltd9-Feb-10 4:14 
AnswerRe: Help with this SQl Logic without using UDF Pin
Not Active9-Feb-10 5:52
mentorNot Active9-Feb-10 5:52 
GeneralRe: Help with this SQl Logic without using UDF Pin
Vimalsoft(Pty) Ltd9-Feb-10 19:41
professionalVimalsoft(Pty) Ltd9-Feb-10 19:41 
GeneralRe: Help with this SQl Logic without using UDF Pin
nainakarri10-Feb-10 17:55
nainakarri10-Feb-10 17:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.