|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Script works in SQLCMD, need to run it in OSQL or similarI have a set of extract scripts that I can run using SQLCMD, but I
need to run them on a SQL Server 7 database server. SQLS7 doesn't have SQLCMD, but it does have OSQL. This leaves me with some challenges: 1. OSQL doesn't have the -W parameter to trim trailing spaces 2. OSQL is wrapping the lines of output 3. OSQL puts >1 >2 >3 >4 etc. at the top of the output file Any suggestions how I can overcome these problems? Phil. I have never tried this but I assume SQLCmd talks to 7.0 ok. Do you have a
2005 server that you can run SqlCmd on and just point it to the 7.0 server? -- Show quoteAndrew J. Kelly SQL MVP Solid Quality Mentors "PhilHibbs" <sna***@gmail.com> wrote in message news:1193832636.665137.143620@k79g2000hse.googlegroups.com... >I have a set of extract scripts that I can run using SQLCMD, but I > need to run them on a SQL Server 7 database server. SQLS7 doesn't have > SQLCMD, but it does have OSQL. This leaves me with some challenges: > > 1. OSQL doesn't have the -W parameter to trim trailing spaces > 2. OSQL is wrapping the lines of output > 3. OSQL puts >1 >2 >3 >4 etc. at the top of the output file > > Any suggestions how I can overcome these problems? > > Phil. > PhilHibbs <sna***@gmail.com> wrote in news:1193832636.665137.143620
@k79g2000hse.googlegroups.com: > I have a set of extract scripts that I can run using SQLCMD, but I From http://www.microsoft.com/downloads/details.aspx?FamilyID=50B97994-> need to run them on a SQL Server 7 database server. SQLS7 doesn't have > SQLCMD, but it does have OSQL. This leaves me with some challenges: > > 1. OSQL doesn't have the -W parameter to trim trailing spaces > 2. OSQL is wrapping the lines of output > 3. OSQL puts >1 >2 >3 >4 etc. at the top of the output file > > Any suggestions how I can overcome these problems? > > Phil. > > 8453-4998-8226-FA42EC403D17&displaylang=en "The SQLCMD utility allows users to connect, send Transact-SQL batches, and output rowset information from SQL Server 7.0, SQL Server 2000, and SQL Server 2005 instances. SQLCMD is a replacement for ISQL and OSQL, but can coexist with installations that have ISQL or OSQL installed." although I haven't myself tried installing it on a machine that only has SQL Server 7. On 31 Oct, 13:16, "Chris.Cheney" <Chris.CheneyXXNOSPA***@tesco.net> Not an option, unfortunately, can't install anything at the supplier'swrote: > "The SQLCMD utility allows users to connect, send Transact-SQL batches, and > output rowset information from SQL Server 7.0, SQL Server 2000, and SQL > Server 2005 instances. SQLCMD is a replacement for ISQL and OSQL, but can > coexist with installations that have ISQL or OSQL installed." site. Phil. On Wed, 31 Oct 2007 12:10:36 -0000, PhilHibbs <sna***@gmail.com>
wrote: >I have a set of extract scripts that I can run using SQLCMD, but I Your item 2 might be corrected by using the -w parameter which "Allows>need to run them on a SQL Server 7 database server. SQLS7 doesn't have >SQLCMD, but it does have OSQL. This leaves me with some challenges: > >1. OSQL doesn't have the -W parameter to trim trailing spaces >2. OSQL is wrapping the lines of output >3. OSQL puts >1 >2 >3 >4 etc. at the top of the output file > >Any suggestions how I can overcome these problems? > >Phil. the user to set the screen width for output. The default is 80 characters. When an output line has reached its maximum screen width, it is broken into multiple lines." Your item 3 is corrected by using the -n parameter to remove numbering. Roy Harvey Beacon Falls, CT |
|||||||||||||||||||||||