Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 7th, 2007, 08:32 AM
Registered User
 
Join Date: May 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to eclecticnancy Send a message via Yahoo to eclecticnancy
Default how to run .sql from cmd

I'm just trying to get started...

I have MSSQL 2000 MSDERelA (free desktop version, doesn't include the gui front end). I don't have permission to install 2005 Express, but am happy using command line if I can just figure out how.

I've typed some basic scripts (text saved as .sql) to create and define some tables, but how do I execute them?

And/or... Do you know where to find (or can you suggest how to search out) "beginner" mssql info that doesn't assume the gui interface?

Thanks...

-Nancy

-Nancy
 
Old May 7th, 2007, 11:26 AM
Authorized User
 
Join Date: Oct 2005
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To execute a script from the command prompt, you will use the osql command. Try searching for this command in Google to get more information on how to use it or simply type "osql /?" to get the parameters that you need to pass to it.

SQL Server Helper
How well do you know SQL? Find out with the free test assessment from SQL Server Helper!!!
http://www.sql-server-helper.com/free-test/default.aspx

Got a SQL Server Question? Ask us here: http://www.sql-server-helper.com/forums/default.asp
 
Old May 7th, 2007, 01:51 PM
Registered User
 
Join Date: May 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to eclecticnancy Send a message via Yahoo to eclecticnancy
Default

Thanks for your help... I got it now.

osql -S localhost\instance -E -i script.sql

-Nancy





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dashes in the server name , cannot run sql cmd combo SQL Server 2000 6 June 20th, 2014 02:02 AM
How Run .sql Script file in MS SQL Server 2000? aarkaycee SQL Server 2000 5 October 12th, 2009 05:43 AM
how to run .sql from cmd (mssql) eclecticnancy BOOK: Beginning SQL 0 May 4th, 2007 03:27 PM
Need help on MS SQL Server 005 Express INSERT cmd VictorVictor ASP.NET 2.0 Professional 7 November 23rd, 2006 02:12 AM
Query to be run against both SQL and Oracle NK Oracle 2 April 26th, 2004 05:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.