Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
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 January 18th, 2005, 09:02 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default sql scripts in command prompt

Hi
I am very new in OSQL, can anyone tell me how to run the sql scripts in command prompt.I searched for this in net, osql is given there but my login is failed. Plz guide me how to run the script from the notepad from one database to another in network.

Regards
Lily
 
Old January 18th, 2005, 06:29 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

You can find useful information on book online. Here is an insert from BOL for your particular issue

If you do not specify a user name when you start osql, SQL Server 2000 checks for the environment variables and uses those, for example, osqluser=(user) or osqlserver=(server). If no environment variables are set, the workstation user name is used. If you do not specify a server, the name of the workstation is used.



Jaime E. Maccou
 
Old January 19th, 2005, 12:49 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

When i am writing as osql -U or osql -P to start osql its asking for password.
How to handle this.

 
Old January 19th, 2005, 01:22 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

osql /U <username> /P <yourpassword>
If neither the -U or -P options are used, SQL Server 2000 attempts to connect using Windows Authentication Mode. Authentication is based on the Microsoft Windows NT® account of the user running osql.

Books online has the complete syntax and switches to use.

what version of SQL do you have?



Jaime E. Maccou





Similar Threads
Thread Thread Starter Forum Replies Last Post
command prompt karthisena BOOK: ASP.NET Website Programming Problem-Design-Solution 1 February 27th, 2007 04:11 AM
Command Prompt karthisena General .NET 2 January 25th, 2007 12:29 PM
Command Prompt Compile andyj00 ASP.NET 1.0 and 1.1 Professional 1 June 16th, 2005 10:28 AM
Command Prompt joconnor PHP How-To 1 August 11th, 2004 06:29 AM





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