Friday, December 04, 2009

sqlcmd 512 characters bug (On SQL server 2008 R2)

On SQL server 2008 R2 November CTP using sqlcmd to output file will result in truncated characters. I have tried this on my PC numerous times and still not getting more than 512 characters.

I have used the following command

sqlcmd -E -S -d master -Q "PRINT REPLICATE('this is testing for more than 512 characters',1000)" -b -o C:\NoMorethan512characters.txt

The above command produced only 512 characters. After further investigation, I found out that this has been reported as a feedback on Microsoft connect sqlcmd 512 characters still not registered as a bug by Microsoft. I hope this is going to be fixed soon.

2 comments:

StartUpFounder said...

There is a free tool "SQLS*Plus" which is an SQL*Plus for SQL Server. Works with SQL Server 2000/2005 and 2008

Very flexible with data formatting (set lines size, pagesize, etc), variables (&, &&), spool, etc - light years better than isql, osql or sqlcmd

I downloaded SQLS*Plus from http://www.memfix.com

SQLServerSimpler said...

why you use sql plus for sql server when you have got SQL Server managment studio?