hiset @xmlDoc=cast(@doc as xml)select Customer.u.value('@CustomerID[1]','varchar(50)') as CustomerID ,Customer.u.value('@ContactName[1]','varchar(50)') as ContactName ,O.x.value('@EmployeeID[1]','int') as EmployeeID ,O.x.value('@OrderDate[1]','Date') as OrderDate ,Od.w.value('@OrderID[1]','int') as OrderID ,Od.w.value('@ProductID[1]','int') as ProductID ,Od.w.value('@Quantity[1]','int') as Quantityfrom @xmlDoc.nodes('ROOT/Customer') as Customer(u) outer apply Customer.u.nodes('./Order') as O(x) outer apply O.x.nodes('./OrderDetail') as Od(w)
1- is missing OpenXML2- maybe varchar(1000) is not enough try varchar(MAX)Ce-am pe mine am si-n dulap, cand ma-mbrac zici ca ma mutsabinWeb