????? ????? SQL Server Desktop Engine (MSDE 2000) ?? SQL Server 2005 Express Edition ???????? ?????? ???????? osql

?????? ????????? ?????? ?????????
???? ???????: 325003 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

??? ??? SQL Server Desktop Engine (???? ????? MSDE 2000) ????? ???????? ?????? ?? ??? ?????? ???? ?? ???????. ?????????? ??????? ?? MSDE 2000 ???? ???????? ???? ?? ?????. ?? ?????? ??????? ???? ??? ??????? ?? MSDE 2000 ?????? ???????? osql. ????? ???????? Sql.exe ? ??????? ?? ?????? MSSQL\Binn ?????? ??????? ?? MSDE 2000. ???? ??? ??????? ????? ????? MSDE 2000 ???????? ?????? ???????? osql.

??? ??? ?????? SQL Server 2005 ? ????? ????? ??????? ?????? ???????? osql ?????? SQL Server 2005 Express Edition. ??? ????? ?? ???? ???? ????? ??? ?????? ?? ????? ??????? ?? Microsoft SQL Server 2005. ???? ?? ?? ?????? ??? ?????? ?? ????? ??????? ?????? ??? ???? ????? ????????? ?????? ??????? ??????. ?????? ?????? ???????? Sqlcmd ????? ?? ???. ????? ?? ????????? ??? ????? ??????? ?????? ???????? Sqlcmd ?? ?????? ???? ???? ????? Microsoft (MSDN) ?????? ??? ?????:
http://msdn2.microsoft.com/en-us/library/ms170207.aspx

?? ??????? Osql ?

?????? ???????? osql ?? ???? ?????? ???? ??????? "Microsoft Windows 32" ???? ????? ????????? ?????? ?????? SQL ???????? ???????? ???????? ?????. ?????? ?????? ???????? osql ?? ODBC ????? ???????? ????? ????? ????????? (API) ??????? ?? ??????.

??? ??? ?????? Osql

?????? ????? ??????? ?????? ???????? osql ??? ?????:
  • ???? ?????? ??? ?????????? ????? ?????? SQL ???????? ?????? ?????? ????? ?? ???? ???????.
  • ?????????? ?? ????? osql ???? ??? ?? ????:
    • ???? ?????? SQL ???????? ????? ???? ???????. - ?? -

    • - ?? - ??? ???????? ?????? ???????? ??? ??? ???????? ??? ???? ????? ??? ?????? SQL ???????? ??????.

???? ?????? Transact-SQL ???? ??????

???? ????? ?????? ???? ???? ?????? ?? ?????? ???????? osql ???? ?? ??? ?? ???? ??????? ?? ???? ????? ??????? ENTER:

osql-?

????? ?? ????????? ??? ?? ???? ?? ?????? ???????? osql ???? ??????? "osql ???????" ?? "??? SQL Server ???????".

?????? ?????? SQL ???????? ???? ??????, ???? ??????? ???????:

  1. ???? ?? ????? MSDE 2000.
  2. ??????? MSDE 2000 (?????? ??? ???? ?? ?????????? ???? ????? ??????? ?????? "??????? SQL Server ??? ?????? Engine (MSDE 2000)").
  3. ?? ???? osql ???? ?????? SQL ???????? ?? ?? ???? ENTER. ??? ????? ??? ENTER ?? ????? ?? ??? ??????? ?????? osql ???????? ??? ??? ?????.

    • ?????? ?????? ??????? ?????? ?????? ???? "??????" ?? ???? ????? ??????? ENTER.

    • ?????? ???? ?????? SQL ???????? ????? ?? ??? SQL ???????? ?? ???? ??????. ?? ???? "??????" ??? ????? ?????? ????? ????? ??????? ????? ?????? ??????? ?????? ??????.

    ???? ??????? ?? ???? ???? ??????.

  4. ?????? ?? osql ???? QUIT ?? ????? ?? ?? ???? ENTER.

????? ?????? Osql

???? ???? ????? ???? "osql" ???? ????????? ?????????. ????? ???:
  • ????? ????? SQL ???????? ????.

    - ?? -

  • - ?? - ???? ?????? ???????? ??? ??? ???????? ???.
????? ??? ???? ?? ????????? ??? ?? ?????.

????? ????? ????? Transact-SQL

????? ????? SQL ???????? ???? ?????????? ??????? MSDE 2000 ? ???? ??? ?????? ????

osql -E - q "????? SQL ????????"

???

  • -E ?????? ?????? Microsoft Windows NT.

    - ? -

  • - ? - -q ????? ??????? SQL ???????? ???? ?? ???? ?????? osql ??? ?????? ?????????.
????? ??????? SQL ???????? ?????? osql ??????? -Q ??????? ????? ?? -q.

???? ??????? ?? ??? ???????? ?????

??????? ?????? ???????? ??? ??? ???????? ??? ???? ??????? ???????:
  1. ????? ??? ???????? ??? ???? ????? ??? ???? ?????? SQL ???????? (??? myQueries.sql).
  2. ???? ???? ??????? ???? ??? ?????? ??? ??? ?? ????? ENTER

    osql E -i input_file

    ???

    input_file ?? ?????? ?????? ???? ???????? ?????. ??? ???? ??????? ??? myQueries.sql ??? ???????? ????? ??????? ?? ?????? C:\Queries ? ?????? ??????? input_file C:\Queries\myQueries.sql.

    ???? ????? ??? ???????? ????? ?? ???? ???? ??????. ??? ???? ????? ??????? ??? ??? ????? ??????? output_file- o ??? ????? ??????? ??????. ??? ???? ??????:

    osql E -i output_file -o input_file

    ???

    output_file ?? ?????? ?????? ???? ???????.

    ????? ??????? ????????? ?????? ?? ??????? ????? ?????? & - n ??? ????? ??????? ??????. ??? ???? ??????:

    osql E -i input_file -o output_file - n

??????? ?? SQL Server ??? ?????? Engine (MSDE 2000)

??????? MSDE 2000 ? ???? ??????? ???????:
  1. ???? ?? ????? MSDE 2000.
  2. ???? ???? ??????? ??? ????????? ???? ?????? ???? MSDE 2000 ???? ???? ???????.
  3. ???? ????? ?????? ?? ???? ????? ??????? ENTER:

    osql -E

    ??? ??????? ??????? ????????? ???? MSDE 2000 ???????? ?????? Windows.

    ??????? ??? ???? ???? MSDE 2000 ????:

    osql servername\instancename -S - E

    ?? ???? ???? ????? ????? ??????? MSDE 2000 ?? ?? ???? ??? ??????? ?? ?????? ??? ???? ??? ???? ???? ?? MSDE 2000 ???? ?? ??????:
    ??????? ????????SQL Server ??? ????? ?? ?? ??? ??????.
    ??????? ????????ConnectionOpen (Connect()).
    ??? ??? ?????? ????? ??? ??????, ???? ?????? ??????:

       1>
    						
    ???? ??? ???????? ??? ????? ??? osql. ????? ???? ????? ?????? SQL ???????? ???? ?????? ????? ??????? ?? ??? ???? ???????.

????? MSDE 2000

??????? ???????? ?? ??? ??????? ?????? ??????? ??? ????? SQL ???????? ?????? ????????? ?????? MSDE 2000.

????? ????? ???? ?????

????? ??? ?????? ??????? ?? SQL Server ??? ????? ???? ????? ???? ????. ??? ??????? ??????? sp_grantlogin ????? ?????? ???? ???? ????? Microsoft Windows (?????? ?? ???? ??????) ??????? ????? ???? SQL Server ??????? ????? SQL Server ???????? ?????? Windows. ?????? ?????? ???? ???????? Windows NT ???? Corporate\Test ??????? ???? SQL Server:
EXEC sp_grantlogin 'Corporate\Test'
				
??? ????? ????? ?????? ?? securityadmin ???? ????? ?????? ???? ????? ??????? sp_grantlogin ?????. ????? ?? ????????? ??? ????? ???? ??????? "?????, ????? ???? SQL" ?? "??? SQL Server ???????".

????? ?? ????????? ??? ??????? sp_grantlogin ????? ???? ?? "sp_grantlogin ? SQL ???????? ????????" ????? ?? "??? SQL Server ???????".

?????? ??????? sp_addlogin ????? ?????? ???? ????? ???? ???? ????????? SQL Server ???????? ?????? ???? SQL. ???? ?????? ?????? ?????? ????? ???? SQL Server ?????? ?????? "??????" ???????? ???? ???? "???????":
EXEC sp_addlogin 'test','hello'
				
??? ????? sysadminsecurityadmin ???? ????? ?????? ???? ????? ??????? sp_addlogin ?????. ????? ?? ????????? ??? ??????? sp_addlogin ????? ???? ?? "sp_addlogin ? SQL ???????? ????????" ????? ?? "??? SQL Server ???????".

?????? ??? ????? ????????

??? ???? ???????? ??? ???? SQL Server ? ?? ???? ?? ????? ????? ?? ????? ?????? ??? ??????? dbo ?????? ??? ????? ????????. ????? ??????? ??????? sp_grantdbaccess ????? ?????? ???? ???? ?? ??? ?????? ???? ??? ????? ???????? ???????. ?????? ?????? ??? ????? ???? ?????? Microsoft Windows NT ???? Corporate\BobJ ??? ????? ???????? ??????? ?? ????? ???? "Bob":
EXEC sp_grantdbaccess 'Corporate\BobJ', 'Bob'
				

????? ??????? sp_adduser ????? ??? ??????? sp_grantdbaccess ????? ???????. ??? ??????? sp_adduser ????? ??? ????? ??????? ?? ????????? ? ???? Microsoft ??????? ??????? sp_grantdbacess ?????.

???? ??? ?????? sysadmin ???? ??? ???? "?" db_accessadmin "?" db_owner ????? ????? ???????? ????? ????? ??????? sp_grantdbaccess ?????. ????? ?? ????????? ??? ??????? sp_grantdbaccess ????? ???? ?? "sp_grantdbaccess ? SQL ???????? ????????" ????? ?? "??? SQL Server ???????".

????? ????? ???? ?????? ?????? ????? ??????

????? ???? ???? ????? ?????? ? ?????? sp_password ??????? ??????. ?????? ?????? ?????? ???? ?????? ?????? "??????"??"?????" ??? "???????" ????? ??????:
EXEC sp_password 'ok', 'hello','test'
				

????? ???????? ?????????? ??? ??? ??????? ?????? ?????? ???? ???? ????? ?????? ?????? ??. ???? ??? ?????? ??? ????? ?????? ????? ???? ???? ????? ???? ?????? ???. ????? ?? ????????? ??? ??????? sp_password ????? ???? ?? "sp_password ? SQL ???????? ????????" ????? ?? "??? SQL Server ???????"

????? ????? ??????

????? ????? ?????? MSDE 2000 ??? ?????? ?? ??????? ???? ????? ??? ?????? ???? ??? ??? ????? "?" ????? "?" ????????? ??????? "?" ?????? ???????? ???? ????? ????? ?? ???????? ?????????. ?????? ????? ?????? MSDE 2000 ?????? ????? "????? ????? ??????" Transact-SQL. ????? ?? ????????? ??? ????? ????? ?????? "? ???? ???????"????? ????? ??????"??" ??? SQL Server ??????? ".

???? ?????? ?????? ?????? ????? ?????? ???? Test. ???? ??? ????? ??? ?????? ?????? ??? ????? "? ???? ????? ?????? ?????? ???? ????? ?????? ???? ?????:
CREATE DATABASE Test
				
????????? ???" ????? ????? ?????? "??? ????? sysadmindbcreator ???? ????? ??????. ????? ?? ????????? ??? ????? "????? ????? ??????" ? ???? ??????? "????? ??????" CREATE, SQL ???????? ????????"??" ??? SQL Server ??????? ".

?????? ???? ????? ?????? ????? ??????? ????? CREATE Transact-SQL. ??? ???? ??????? ?????? ???? ????? ?????? ????? "CREATE TABLE" Transact-SQL. ????? ?? ?????????? ???? "??? SQL Server ???????".

????? ????????? ???????? ????? ??????

???? ?????? "????? ????????? ??????????" SQL Server ????? ???? ?????? ???????? ?????? ??????? ?? ????? ?????? SQL Server.

?? ????? ???????? ????? ?????? ?????? ??????? ?? ??? ?????? ?? ??? ?? ???:
  • ??? ?? ???????.
  • ????? ????????.
  • ????? ???? ????.
???????? ??? ???? ????? ????????? ?????? ???????? ?????????? ????? ?????? ????? ??? ??? ????? ?????? ?? ???? ???? ??? ???. ????? ????????? ????? ?????? ?? ??????? ???? ?? ??????? ????? ???????? ??? ??? ????? ?????? ????? ???? ?? ????? ??????.

?????? ??? ???? ?? ????????? ??? ????? ?????? ????? ????????? ?????? ?????????, ???? ??????? "????? ????? ????????? ? ??????? ??????" ?? "??? SQL Server ???????".

?????? ?????? ?????? ????? ??????? ?????? ?????? ????? ?????? ?????? ???? mydb ????? Mydb.bak ????? ????????? ?? ?? ???? ?????? ????? ????????? ?? ?????? C:\Msde\Backup:

BACKUP DATABASE mydb TO DISK = 'C:\MSDE\Backup\mydb.bak'
				

?????? ?????? ?????? ???? ???????? ??? ????? ?????? ???? mydb ????? Mydb_log.bak ????? ????????? ?? ?? ???? ?????? ?? ?????? C:\Msde\Backup:

BACKUP LOG mydb TO DISK = 'C:\MSDE\Backup\mydb_log.bak'
				

????? ????? ?????? ????? ????????? ? ??? ????? ????????? ????????? ???????? ??? ????? ??? ?????? ???? ????? ?????? ?????? db_ownerdb_backupoperator ????? ????? ????????. ?????? ??? ???? ?? ????????? ??? ???? ???????? ????? ????????? ???? ??????? "????? ?????????, SQL ???????? ????????" ?? "??? SQL Server ???????".


????? MSDE ???? SQL Server ???? ?????? ?????? ????????. ??? ???? ??????? ????? ????? ?? ????? ???? ????? ??????? SQL ????????. ????? ???? ???? SQL Server ????? ????. ?????? ??? ????? ????????? ???????? ??? ????? ??????? ????????? ??????? ???????? ?? MSDE 2000 ????? ????? ??????? ???????? ????? ????????? ? ???? ??????? ??????? ?? "????? ??????? ?? Microsoft:
241397????? ??? ???? ???????? ?? ????? ?????? ???? Microsoft Data ???????? Transact-SQL
????? ?? ????????? ??? ???? ???? SQL Server ???? ??????? "???? ???? SQL Server" ?? "??? SQL Server ???????".

??? ????? ????????? ????? ?????? ??? ???????. ?? ????? ?? ???? ????? ??????? ????? ???????? ?? ?????? ????????. ?????? ?????? ??? ??????? ????? ?????? ?????? mydb ?? ??? ?????? ?????????? C:\Msde\Backup\Mydb.bak:

RESTORE DATABASE mydb FROM DISK ='C:\MSDE\Backup\mydb.bak'
				
?? ???? ??? ???? ????? ???????? ???? ??? ???? ??????? ??? ?? ???? ??? ???????? ???????? "????? ????? ??????" ?????? ????? ?????????. ?? ???? ???? ????? ???????? ????? ??????? ???????? ?????????? ?????? ?? ????? ?????? sysadmin ? dbcreator ????? ?????? ? ???? ????? ???????? (dbo). ?????? ??? ???? ?? ????????? ??? ???? ???????? ????????? ???? ??????? "RESTORE ? SQL ???????? ????????" ?? "??? SQL Server ???????".

????? ? ??? ????? ??????

???? ??? ???????? ?????? ??? ???????? ?? ????? ?????? ?????? ?? reattached ??? ???? ??? ?? ??? ??? ??????. ??? ????? ?????? ????? ????? ???????? ?? SQL Server ????? ???? ????? ???????? ??? ?? ?? ????? ??? ???????? ????????? ???? ????? ????? ????????. ?? ????? ??????? ??? ??????? ??? ???????? ????????? ?????? ????? ???????? ??? ?? ???? SQL Server ??? ?? ??? ?????? ?? ??? ????? ????????. ???? ??? ????? ???????? ???????? ?? ?????? ???? ?????? ???? ??? ????? ????? ?? ???. ????? ?? ?????????? ???? ??????? "????? ? ??? ????? ??? ??????" ?? "??? SQL Server ???????".

?????? ?????? ???? ????? ?????? ?????? mydb ?? ???? SQL Server ??????:
EXEC sp_detach_db 'mydb'
				
??? ????? ??? ?????? ???? ????? ?????? ???? ????? ??????? sp_detach_db ?????. ????? ?? ????????? ??? ??????? sp_detach_db ????? ???? ?? "sp_detach_db ? SQL ???????? ????????" ????? ?? "??? SQL Server ???????".

?????? ?????? ??? ????? ?? ????? ?????? ?????? mydb ??? ???? SQL Server ??????:
EXEC sp_attach_db @dbname = N'mydb', 
   @filename1 = N'C:\MSDE\Backup\mydb.mdf', 
   @filename2 = N'C:\MSDE\Backup\mydb.ldf'
				
??????? ????? ?????? N ??????? ???? ????? Unicode. ???? ??????? "N" ????? ?????? ?? ??????? SQL-92. ????? ?? ?????????? ???? ??????? ??????? ?? "????? ??????? ?? Microsoft:
239530INF: ????? Unicode ??????? ?? SQL Server ????? ????? N
???? ??? ?????? sysadmin ? dbcreator ???? ????? ?????? ????? ??? ???????. ????? ?? ????????? ??? ??????? sp_attach_db ????? ???? ?? "sp_attach_db ? SQL ???????? ????????" ????? ?? "??? SQL Server ???????".

????? ????????? ??????? ??? ????????? ?????? ???????? osql ???? ??? ???? ??????? Microsoft SQL Server 2000.

?????

?????? ????? ???? ?? SQL Server 2000 ???????? ?? ?????? ???? Microsoft ?????? ??? ?????:
http://technet.microsoft.com/en-us/sqlserver/bb331756.aspx
?????? ????? SQL Server 7.0 ?? SQL Server ???????? ?? ?????? ???? Microsoft ?????? ??? ?????:
http://download.microsoft.com/download/SQL70/File/2/Win98/En-US/SQLBOL.exe
????? ?? ????????? ??? MSDE 2000 ???? ???????? ??????? ?? "????? ????? Microsoft:
319930????? ??????? ????? ?? SQL Server Desktop Edition ?? ?? SQL Server 2005 Express Edition
241397????? ??? ???? ???????? ?? ????? ?????? ???? ??? ?????? Microsoft ???????? Transact-SQL

???????

???? ???????: 325003 - ????? ??? ??????: 04/?? ??????/1428 - ??????: 2.3
????? ???
  • Microsoft SQL Server 2000 Desktop Engine (Windows)
  • Microsoft SQL Server 2000 Desktop Engine (MSDE) SP3a
????? ??????: 
kbmt kbdownload kbhowtomaster KB325003 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????325003
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com