Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Space in output file

Author  Topic 

raghuigate
Starting Member

5 Posts

Posted - 2013-06-03 : 09:17:48
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 - 2013-06-03 : 09:37:59
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
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2013-06-03 : 09:48:41
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
   

- Advertisement -