Just put the table name in the @TableName variable.
You can also apply filtering in the where clause to only get certian fields.
pawonwatcsv, 2016-08-30 (first published: 2015-03-23)
Just put the table name in the @TableName variable.
You can also apply filtering in the where clause to only get certian fields.
DECLARE @TableName SYSNAME = 'tablename' SELECT REPLACE(REVERSE(STUFF(REVERSE((SELECT name + ',' AS [data()] FROM sys.columns WHERE OBJECT_NAME(object_id) = @TableName ORDER BY column_id FOR XML PATH(''))),1,1,'')),' ','')
Read 2,853 times
(12 in last 30 days)
JSON is a viable option for transferring data between systems. It has the ability to include schema information along with the data which is an advantage over CSV files. In this article, Phil Factor demonstrates how he takes advantage of JSON when exporting or importing tables.
2018-12-05
3,025 reads
In this article, we will see of a quick way to load CSV files from a directory on your computer.
2018-09-18
8,833 reads
Phil Factor is not amused by SQL Server's handling of the comma-separated value (CSV) file format.
2018-08-27
500 reads
In this example we will join two CSV files with a common column using SQL Server.
2017-01-23
7,378 reads
Despite the neglect of the basic ODBC drivers over the years, they still afford a neat way of reading from, and writing to, CSV files; and to be able to do so in SQL as if they were tables is somewhat magical. Just to prove it is possible, Phil Factor creates a CSV version of AdventureWorks as a linked server.
2012-05-11
5,604 reads
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy