Hi,
I have a table with nvarchar(max) column where i have store the xml data.
I want to export this nvarchar(max) xml data into my local drive.
how to achieve that?
Thanks
Hi,
I have a table with nvarchar(max) column where i have store the xml data.
I want to export this nvarchar(max) xml data into my local drive.
how to achieve that?
Thanks
SSMS has so called SQLCMD Mode. It allows to output result of a query to a local file system.
SQL
-- To switch to SQLCMD Mode - select Query from the menu and then select SQLCMD Mode.
:out e:\Temp\outputFileName.xml
SET NOCOUNT ON;
SELECT TOP(10) [CurrencyCode]
,[Name]
,[ModifiedDate]
FROM [AdventureWorks].[Sales].[Currency]
FOR XML PATH('row'), TYPE, ROOT('root');
GO
You can also use BCP from the command line:
BCP "SELECT xmlcol FROM db.dbo.tbl" queryout xmlcol.xml -w -T -S server\instance
-w stands for "wide character", that is UTF-16. -T is for trusted connection.
15 people are following this question.
Year and Month aggregation in same Pivot table in SQL Server
SQL Server Query for Searching by word in a string with word breakers
How to show first row group by part id and compliance type based on priorities of Document type?
Query to list all the databases that have a specific user
T-sql query to find the biggest table in a database with a clustered index