Extended Property

Technical Article

RE: How to format osql output

  • Reply

You need to create fixed sized variables for each column in the select query that can then be used to generate the result set. E.gdeclare @res1 varchar(20)declare @res2 varchar(10) select @res1 = left(col1,20),@res2 = left(col2,10)from tableYou will then get fixed sizes so that the columns line up.Also to increase width of text file use:-wFor more parameters see:http://www.sql-server-performance.com/rd_osql.asp

2004-09-20

2 reads

Blogs

Advent of Code 2022

By

Foreword Advent of Code is an annual event in which participants solve a series of...

Daily Coping 8 Dec 2022

By

Today’s coping tip is to be curious. Learn about a new topic or an...

#PowershellBasics: Warnings and how to hide them.

By

One of my favorite parts of having a new job is that I learn...

Read the latest Blogs

Forums

The Enterprise Roadmap to Reducing Costs (While Increasing Value)

By Additional Articles

Comments posted to this topic are about the item The Enterprise Roadmap to Reducing...

The Temp Alias

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Temp Alias

Connect to SQL Server with Python to Create Tables, Insert Data and Build Connection String

By Additional Articles

Comments posted to this topic are about the item Connect to SQL Server with...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers

Question of the Day

The Temp Alias

See possible answers