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
 MANIPULATE TEXT FILE

Author  Topic 

yaman
Posting Yak Master

213 Posts

Posted - 2010-09-01 : 15:35:45
Sir ,

I have one text file .Text file have table data like

1,A,RAJ
2,B,SID
3,C,CAT

Now i want to add a char "!data" on the top of the file using sql server 2005 .After add this char my file look like this .
How can i achieve this Please help me out sir .

!data
1,A,RAJ
2,B,SID
3,C,CAT


Yaman

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-09-01 : 15:43:19
Use VBScript for this, not T-SQL.

You can do it with xp_cmdshell via type and concatenating another file to it, but that is highly not recommended.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -