Unfortunately OPENXML and sp_xml_preparedocument don't automatically use the default namespace, so you have to declare it and use it explicity, like this:DECLARE @idoc intDECLARE @doc varchar(1000)SET @doc ='<?xml version="1.0"?><DtecBS xmlns="http://www.bsi.si" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bsi.si http://www.bsi.si/_data/tecajnice/DTecBS.xsd"><tecajnica datum="2007-01-12"><tecaj oznaka="USD" sifra="840">1.2893</tecaj><tecaj oznaka="DKK" sifra="208">7.4529</tecaj></tecajnica></DtecBS>'--Create an internal representation of the XML document.EXEC sp_xml_preparedocument @idoc OUTPUT, @doc, '<root xmlns:bsi="http://www.bsi.si"/>'SELECT *FROM OPENXML (@idoc, 'bsi:DtecBS/bsi:tecajnica/bsi:tecaj', 2)WITH (oznaka varchar (3) '@oznaka',sifra varchar(10) '@sifra',tecaj decimal(18,4) 'text()')-- Remove the internal representation.exec sp_xml_removedocument @idoc