Microsoft SQL Server Management Studio - query result as text

I have a database in Microsoft SQL Server and I use Microsoft SQL Server Management Studio.

I have the opportunity to insert the result of the query into a file, although the query results are not separated by any special characters.

Looks like this

select * from table_name 

Output:

 18 182 3386 NULL 18 790 12191 NULL 

In file:

 18 182 3386 NULL 18 790 12191 NULL 

Is it possible to change the request, so after each entry it will add a special char, for example:

In file:

 18; 182; 3386; NULL; 18; 790; 12191; NULL; 

It will be easier for me to copy this database to other programs.

+6
source share
2 answers

In SSMS:

Tools > Options > Query Results > Results To Text

The top option is Output Format , can set the separator there.

+6
source

Click here

Click here on SSMS before executing the request.

+7
source

Source: https://habr.com/ru/post/958177/


All Articles