SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Space in output file
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

raghuigate
Starting Member

5 Posts

Posted - 06/03/2013 :  09:17:48  Show Profile  Reply with Quote
I have run a query and output need to be save in text file. The requirement is to add extra space at the begenning of every record including column header. But the problem with the dotted line which separates data and column header. I need a space to be appended before to dotted line also.

SELECT ' '+number AS ' PXXXX_NUMBER'

Output:

PXXXX_NUMBER CAAAAAAA_ID CAAAAAAA_YYYY_NNNN
--------------- ----------- ------------------
10009968 65576231 ABCDE
10009968 62821 ABCDE
10009968 62221 ABCDE

raghuigate
Starting Member

5 Posts

Posted - 06/03/2013 :  09:37:59  Show Profile  Reply with Quote
PXXXX_NUMBER CAAAAAAA_ID CAAAAAAA_YYYY_NNNN
--------------- ----------- ------------------
10119968 65576231 ABCDE
10119968 62821 ABCDE
10119968 62221 ABCDE

I need results to be:
PXXXX_NUMBER CAAAAAAA_ID CAAAAAAA_YYYY_NNNN
------------- ----------- ------------------
10119968 65576231 ABCDE
10119968 62821 ABCDE
10119968 62221 ABCDE
Go to Top of Page

webfred
Flowing Fount of Yak Knowledge

Germany
8765 Posts

Posted - 06/03/2013 :  09:48:41  Show Profile  Visit webfred's Homepage  Reply with Quote
To show the formatted post you can use tags [C0DE] [/C0DE]

PXXXX_NUMBER  CAAAAAAA_ID CAAAAAAA_YYYY_NNNN
--------------- ----------- ------------------
  10119968       65576231    ABCDE
  10119968       62821       ABCDE
  10119968       62221       ABCDE

I need results to be:
  PXXXX_NUMBER  CAAAAAAA_ID CAAAAAAA_YYYY_NNNN
  ------------- ----------- ------------------
  10119968       65576231    ABCDE
  10119968       62821       ABCDE
  10119968       62221       ABCDE



Too old to Rock'n'Roll too young to die.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000