I am trying to extract the values from an mdf database to excel, but i can't display the header texts(title fields). I can only view the values. In order to make this work i need a query like this below, but it seems that select with cte
gives me an error.
Sql-server – Visual Studio extract database values to excel with header text!
sql servervbavisual studio
Related Question
- Sql-server – SQL Server 2008 Convert String to Datetime question
- Sql-server – Visual Studio Database Project
- Sql-server – Unable to attach database to Amazon RDS using SQL Server Management Studio 2016
- Sql-server – Inserting ID and Date to locate data for C#/VBA application
- Sql-server – way to group the output of a query based on two rows
- Sql-server – SQL SERVER: Header Blocker Across Multiple Databases with wait type CXCONSUMER
Best Answer
When you paste code as an image, it's difficult the take that code and rewrite it to show you the correct way to do it. You should always paste your code as text when asking a question.
You need to put the
WITH CTE
at the beginning of thesql =
, such that