Syntax ------ ;WITH XMLNAMESPACES (DEFAULT

Hi,

I am querying the SSRS ReportServer database for connection strings. I came across a script on https://gallery.technet.microsoft.com/scriptcenter/List-connection-strings-of-1a9a9adc

The article uses the opening T-SQL, WITH XMLNAMESPACES (DEFAULT 

I've never seen this syntax before.... what does the DEFAULT mean in this scenario?

Thanks,

February 6th, 2015 6:27am

Hello Ben,

See MSDN WITH XMLNAMESPACES (Transact-SQL), with that synatx you can address the Default and several named namespaces, which are used in XML data. If you have a look at the raw XML returned by the query you get this

<DataSourceDefinition xmlns="http://schemas.microsoft.com/sqlserver/reporting/2006/03/reportdatasource">
  <Extension>SQL</Extension>
  <ConnectString>Data Source=MySqlServer;Initial Catalog=MyDatabase</ConnectString>
  <CredentialRetrieval>Integrated</CredentialRetrieval>
  <Enabled>True</Enabled>
</DataSourceDefinition>
where the xmlns = XML Namespace is used, the same as the Default Namespace in the query.

Free Windows Admin Tool Kit Click here and download it now
February 6th, 2015 6:38am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics