I thought it is a very simple task to export data in a view from SQL Server 2005 to a fixed width text file. But the wizard is a pain. The format is not correct. Does anybody know how to deal with it? or any better way to do that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use bcp with queryout option http://msdn.microsoft.com/en-us/library/ms162802(SQL.90).aspx
Use a format file if you want fixed-width output
http://weblogs.sqlteam.com/brettk/archive/2006/07/06/10504.aspx
I just tried exporting in AdventureWorks, Fixed Width gave me a lot of issues too (compared to column delimiters) I had to ignore the GUID columns, not include column names in the first row, etc.. finally exported Sales.Customer table
Without BCP, you may have to look into SSIS or SQLCMD