Groups | Blog | Home
all groups > sql server new users > june 2006 >

sql server new users : Query question


Garth
6/18/2006 10:41:44 AM
Is there a way within SQL to create a query with carriage returns within the
output, so that the whole query is not all on one line?



For example

Instead of having "Make, Mode, Time , Date, etc."



Return something like this:

Make, Mode

Time, Date

Etc..

Arnie Rowland
6/18/2006 11:38:09 PM
This may work -somewhat depends upon your output viewing tool.=20

USING Northwind
GO

SELECT=20
LastName
, char(13) + FirstName
, char(13) + City
, char(13) + PostalCode
FROM Employees

In Query Analyzer, this need 'Text' view -NOT 'Grid' view.

--=20
Arnie Rowland, YACE*=20
"To be successful, your heart must accompany your knowledge."

*Yet Another Certification Exam


[quoted text, click to view]
Garth
6/19/2006 12:00:00 AM
Thank Arnie, but I have yet another question is there a way to force QA =
into text mode via the query?
[quoted text, click to view]
This may work -somewhat depends upon your output viewing tool.=20

USING Northwind
GO

SELECT=20
LastName
, char(13) + FirstName
, char(13) + City
, char(13) + PostalCode
FROM Employees

In Query Analyzer, this need 'Text' view -NOT 'Grid' view.

--=20
Arnie Rowland, YACE*=20
"To be successful, your heart must accompany your knowledge."

*Yet Another Certification Exam


[quoted text, click to view]
Arnie Rowland
6/19/2006 9:09:31 AM
Not that I know of.=20

But you could use osql and output to a file.

--=20
Arnie Rowland, YACE*=20
"To be successful, your heart must accompany your knowledge."

*Yet Another Certification Exam


[quoted text, click to view]
Thank Arnie, but I have yet another question is there a way to force =
QA into text mode via the query?
[quoted text, click to view]
This may work -somewhat depends upon your output viewing tool.=20

USING Northwind
GO

SELECT=20
LastName
, char(13) + FirstName
, char(13) + City
, char(13) + PostalCode
FROM Employees

In Query Analyzer, this need 'Text' view -NOT 'Grid' view.

--=20
Arnie Rowland, YACE*=20
"To be successful, your heart must accompany your knowledge."

*Yet Another Certification Exam


[quoted text, click to view]
Garth
6/19/2006 1:55:10 PM
Thanks.. But using osql is not an options... time to rethink the =
query... but I'm not sure that is possible.=20
[quoted text, click to view]
Not that I know of.=20

But you could use osql and output to a file.

--=20
Arnie Rowland, YACE*=20
"To be successful, your heart must accompany your knowledge."

*Yet Another Certification Exam


[quoted text, click to view]
Thank Arnie, but I have yet another question is there a way to force =
QA into text mode via the query?
[quoted text, click to view]
This may work -somewhat depends upon your output viewing tool.=20

USING Northwind
GO

SELECT=20
LastName
, char(13) + FirstName
, char(13) + City
, char(13) + PostalCode
FROM Employees

In Query Analyzer, this need 'Text' view -NOT 'Grid' view.

--=20
Arnie Rowland, YACE*=20
"To be successful, your heart must accompany your knowledge."

*Yet Another Certification Exam


[quoted text, click to view]
AddThis Social Bookmark Button