Managing MSDE 2000 or SQL Server 2005 Express Edition using osql utility

Specify a Single Transact-SQL Statement

To run a Transact-SQL statement against the local default instance of MSDE 2000, type a command similar to this one

osql -E -q "Transact-SQL statement"

where

  • E uses Microsoft Windows NT authentication.
  • q runs the Transact-SQL statement but does not exit osql when the query completes.

To run the Transact-SQL statement and exit osql, use the Q argument instead of -q.

To run a Transact-SQL statement against a non local default instance of MSDE 2000, type a command similar to this one

osql -Usa -PmyPassword -S .\MyMSDEInstance -q "Transact-SQL statement"

where

  • U uses SQL authentication.
  • P password for SQL account.
  • S non default instance.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: