Sql server express localdb

Команды OSQLOSQL Commands

Помимо инструкций Transact-SQLTransact-SQL в программе osqlтакже доступны следующие команды.In addition to Transact-SQLTransact-SQL statements within osql, these commands are also available.

Get-HelpCommand ОписаниеDescription
GOGO Выполняет все инструкции, введенные после последней команды GO.Executes all statements entered after the last GO.
RESETRESET Очищает все введенные инструкции.Clears any statements you have entered.
QUIT или EXIT( )QUIT or EXIT( ) Завершение работы программы osql.Exits from osql.
CTRL+CCTRL+C Завершает запрос без выхода из программы osql.Ends a query without exiting from osql.

Примечание

Команды !!The !! и ED больше не поддерживаются программой osql.and ED commands are no longer supported by osql.

Признаки конца команды GO (по умолчанию), RESET, EXIT, QUIT и CTRL+C распознаются только в начале строки, сразу после запроса программы osql .The command terminators GO (by default), RESET EXIT, QUIT, and CTRL+C, are recognized only if they appear at the beginning of a line, immediately following the osql prompt.

GO обозначает конец пакетного файла и исполнения любых кэшированных инструкций Transact-SQLTransact-SQL .GO signals both the end of a batch and the execution of any cached Transact-SQLTransact-SQL statements. При нажатии клавиши ВВОД в конце каждой строки ввода программа osql выполняет кэширование инструкций из этой строки.When you press ENTER at the end of each input line, osql caches the statements on that line. При нажатии клавиши ВВОД после ввода команды GO все текущие инструкции в кэше отправляются в виде пакета в SQL ServerSQL Server.When you press ENTER after typing GO, all of the currently cached statements are sent as a batch to SQL ServerSQL Server.

Последняя версия программы osql работает таким образом, как будто в конце любого выполняемого скрипта имеется подразумеваемая инструкция GO, поэтому выполняются все инструкции скрипта.The current osql utility works as if there is an implied GO at the end of any script executed, therefore all statements in the script execute.

Закончите команду с помощью ввода строки, которая начинается с признака конца команды.End a command by typing a line beginning with a command terminator. Следом за признаком конца команды можно ввести целое число, чтобы указать, сколько раз выполнить команду.You can follow the command terminator with an integer to specify how many times the command should be run. Например, чтобы выполнить эту команду 100 раз, введите:For example, to execute this command 100 times, type:

Результаты выводятся на печать один раз после завершения.The results are printed once at the end of execution. Программаosql не принимает более 1000 символов в одной строке.osql does not accept more than 1,000 characters per line. Большие инструкции должны вводиться в несколько строк.Large statements should be spread across multiple lines.

Для повторного вызова и изменения инструкций osql могут использоваться средства повторного вызова команд Windows.The command recall facilities of Windows can be used to recall and modify osql statements. Существующий буфер запросов можно очистить с помощью команды RESET.The existing query buffer can be cleared by typing RESET.

При запуске хранимых процедур программа osql выводит пустую строку между результирующими наборами в пакете.When running stored procedures, osql prints a blank line between each set of results in a batch. Кроме того, сообщение «обработано строк: 0» не выводится, если оно не применимо к выполненной инструкции.In addition, the «0 rows affected» message does not appear when it does not apply to the statement executed.

Технологии

Движок БД

Это основной сервис для хранения, обработки и защиты данных. Компоненты Database Engine обеспечивает контролируемый доступ и быструю обработку транзакций для удовлетворения требований самых требовательных приложений, потребляющих данные, на предприятии. Database Engine также обеспечивает расширенную поддержку для обеспечения высокой доступности.

Репликация

Репликация — это набор технологий для копирования и распределения данных и объектов базы данных из одной базы данных в другую, а затем синхронизации между базами данных для обеспечения согласованности. Используя репликацию, мжно распространять данные в разных местах, в том числе мобильным пользователям с помощью локальных и глобальных сетей, подключений удаленного доступа, беспроводных подключений и Интернета.

Integration Services

Integration Services — это платформа для создания высокопроизводительных решений для интеграции данных, включая пакеты, которые обеспечивают обработку извлечения, преобразования и загрузки (ETL) для хранилищ данных.

Analysis Services

Analysis Services — это аналитическая платформа данных и набор инструментов для личной, командной и корпоративной бизнес-аналитики. Разработчики серверов и клиентов поддерживают традиционные решения OLAP, новые решения для табличного моделирования, а также аналитику самообслуживания и совместную работу с использованием Power Pivot, Excel и среды SharePoint Server. Службы Analysis Services также включают интеллектуальный анализ данных, для раскрытия скрытых шаблонов, в больших объемах данных .

Description

The LocalDB setup program uses the program to install the necessary files on the computer. Once installed, LocalDB is an instance of SQL Server Express that can create and open SQL Server databases. The system database files for the database are stored in the local AppData path, which is normally hidden. For example, . User database files are stored where the user designates, typically somewhere in the folder.

For more information about including LocalDB in an application, see Visual Studio Local Data Overview, Create a database and add tables in Visual Studio.

For more information about the LocalDB API, see SQL Server Express LocalDB Reference.

The utility can create new instances of LocalDB, start and stop an instance of LocalDB, and includes options to help you manage LocalDB.For more information about the utility, see SqlLocalDB Utility.

The instance collation for LocalDB is set to and cannot be changed. Database-level, column-level, and expression-level collations are supported normally. Contained databases follow the metadata and collations rules defined by Contained Database Collations.

Restrictions

  • LocalDB cannot be patched beyond Service Packs. CUs and Security Updates cannot be applied manually and will not be applied via Windows Update, Windows Update for Business, or other methods.

  • LocalDB cannot be managed remotely via SQL Management Studio.

  • LocalDB cannot be a merge replication subscriber.

  • LocalDB does not support FILESTREAM.

  • LocalDB only allows local queues for Service Broker.

  • An instance of LocalDB owned by the built-in accounts such as can have manageability issues due to windows file system redirection. Instead use a normal windows account as the owner.

Automatic and named instances

LocalDB supports two kinds of instances: Automatic instances and named instances.

  • Automatic instances of LocalDB are public. They are created and managed automatically for the user and can be used by any application. One automatic instance of LocalDB exists for every version of LocalDB installed on the user’s computer. Automatic instances of LocalDB provide seamless instance management. There is no need to create the instance; it just works. This feature allows for easy application installation and migration to a different computer. If the target machine has the specified version of LocalDB installed, the automatic instance of LocalDB for that version is available on the target machine as well. Automatic instances of LocalDB have a special pattern for the instance name that belongs to a reserved namespace. Automatic instances prevents name conflicts with named instances of LocalDB. The name for the automatic instance is MSSQLLocalDB.

  • Named instances of LocalDB are private. They are owned by a single application that is responsible for creating and managing the instance. Named instances provide isolation from other instances and can improve performance by reducing resource contention with other database users. Named instances must be created explicitly by the user through the LocalDB management API or implicitly via the app.config file for a managed application (although managed application may also use the API, if desired). Each named instance of LocalDB has an associated LocalDB version that points to the respective set of LocalDB binaries. The instance name of a LocalDB is sysname data type and can have up to 128 characters. (This differs from regular named instances of SQL Server, which limits names to regular NetBIOS names of 16 ASCII chars.) The name of an instance of LocalDB can contain any Unicode characters that are legal within a filename.A named instance that uses an automatic instance name becomes an automatic instance.

Different users of a computer can have instances with the same name. Each instance is a different processes running as a different user.

Using SQL Server with client/server applications

You can install just the SQL Server client components on a computer that is running client/server applications that connect directly to an instance of SQL Server. A client components installation is also a good option if you administer an instance of SQL Server on a database server, or if you plan to develop SQL Server applications.

The client tools option installs the following SQL Server features: backward compatibility components, SQL Server Data Tools, connectivity components, management tools, software development kit, and SQL Server Books Online components. For more information, see Install SQL Server.

Установка SQL сервера 2000

Перед началом установки вставьте CD с Windows SQL 2000 в CD-ROM и запустите любой из менеджеров (Windows Explorer, Total Commander). Найдите в каталоге CD найдите Setup.bat и запустите его.

Перед Вами стартовое окно. Опция “Install Database Server” позволяет начать процесс установки сервера SQL 2000. Для этого нажимаем Next. Существует три варианта установки SQL, выберите необходимый:   

  • Local Computer– установка сервера SQL на локальный компьютер;

        

  • Remote Computer – установка сервера SQL на удаленный компьютер по сети;

        

  • Virtual Server – установки сервера SQL в кластер серверов.

Описание будет проводится так, якобы была выбрана установка сервера на локальный компьютер.

Выбираем следующие опции:

Create a new instance, or install Client Tools – позволяет установить новый экземпляр сервера SQL и инструменты клиента (Client Tools)

Upgrade, remove, or add components – позволяет работать с уже установленным экземпляром.

Advance options – позволяет создавать индивидуальные установочные файлы, восстанавливать ключи регистра и поддерживать Виртуальные Серверы.

Мы выберем Create a new instance, or install Client Tools и нажмем Next.

В полях Name и Company вводим имя и компанию, нажимаем Next. Когда перед Вами появится окошко с правилами использования, нажимаем Yes (да, мы согласны с условиями лицензии).

Теперь следует выбрать тип инсталляции.

Client Tools Only — установить клиентскую часть для работы с удаленным SQL сервером.

Server and Client Tools — установить клиентскую часть и SQL сервер на одном компьютере.

Connectivity only – установить Data Access Components (DAC) и Сетевые библиотеки (Network Libraries), так чтобы приложения могли получать доступ к экземпляру сервера SQL.

 Если у Вас в сети уже есть установленный «удаленный» SQL сервер, выбирайте Client Tools Only, иначе — Server and Client Tools. Нажимаем Next.

Необходима помощь специалистов? Оставьте заявку. Мы с Вами свяжемся.

Если выбран режим Default, то сервер SQL будет установлен как экземпляр по умолчанию. Но если Вы хотите, Вы можете установить именованный экземпляр. Для этого выключите переключатель Default и введите имя экземпляра в поле Instance Name. Нажимаем кнопочку Next.

Теперь определим объем инсталляции.

  • Typical – установка обязательных файлов и наиболее часто используемых необязательных файлов.

Minimum – установка только обязательных файлов.

Custom – можно самостоятельно определить, какую конфигурацию SQL сервера Вы желаете установить.

Так же нужно выбрать папки для Program Files и Data Files, в которые будет производиться инсталляция. Next.

Сервер SQL 2000 использует две учетные записи: для агента сервера (Server Agent) SQL и для самого сервера SQL. Теперь пора определиться: использовать ли одну и ту же учетную запись для обеих служб или же будут созданы отдельные учетные записи для каждой службы отдельно. Если Вы будете использовать только одну учетную запись, тогда нужно еще выбрать, будет она локальной учетной записью (local system account) или учетной записью пользователя домена (domain user account). Если Вы пользуетесь только одним сервером SQL в сети, и Вы не планируете его взаимодействие с другими серверами SQL или удаленными серверами, Вы можете использовать только локальную учетную запись. Для примера выберем “Use the same account for both services. Autostart SQL Server Agent Service”, “Use the Local System account”.

Режим аутентификации для доступа к базам данных может осуществляться операционной системой либо сервером SQL. Лучше вариант “Windows Authentication Mode”, при котором все идентификации обрабатываются через систему безопасности Windows для пользователей и групп.

Выбор способа сортировки символов (collation) по умолчанию. Выберите “SQL Server Collations”, “Dictionary order, case-insensitive, for use with 1252 Character Set”, а затем нажмите Next.

Теперь выберите сетевые библиотеки. Сохраните настройки по умолчанию и нажмите кнопку Next

После возникновения в окошке надписи «Setup has enough information to prompt you for the licensing mode information and start copying the program files. Click Back to review or change the settings, otherwise click Next to proceed.» Чтобы продолжить установку, нажмите Next.

Введите тип и число лицензий, которые вы приобрели и нажмите кнопку Continue.

Установка благополучно завершена!!!

Теперь, чтобы найти инструменты, которые используются для работы с сервером SQL, щелкните мышью на кнопке Start на панели инструментов и выберите меню Programs и Microsoft SQL Server.

Возможности пользовательского экземпляраUser Instance Capabilities

Пользовательские экземпляры полезны для пользователей, работающих под управлением Windows с учетной записью пользователя с минимальными правами доступа (LUA).User instances are useful for users who are running Windows under a least-privilege user account (LUA). Каждый пользователь имеет права SQL Server системного администратора ( ) для экземпляра, работающего на своем компьютере, без необходимости запуска от имени администратора Windows.Each user has SQL Server system administrator () privileges over the instance running on their computer without needing to run as a Windows administrator as well. Программное обеспечение, выполняемое в пользовательском экземпляре с ограниченными разрешениями, не может вносить изменения на уровне системы, так как экземпляр SQL Server Express работает под учетной записью пользователя Windows без прав администратора, а не как служба.Software executing on a user instance with limited permissions cannot make system-wide changes because the instance of SQL Server Express is running under the non-administrator Windows account of the user, not as a service. Каждый пользовательский экземпляр изолирован от родительского и любых других пользовательских экземпляров, выполняющихся на том же компьютере.Each user instance is isolated from its parent instance and from any other user instances running on the same computer. Базы данных, запущенные в пользовательском экземпляре, открываются только в однопользовательском режиме. Таким образом несколько пользователей не могут подключаться к базам данных, запущенным в пользовательском экземпляре.Databases running on a user instance are opened in single-user mode only, and it is not possible for multiple users to connect to databases running on a user instance. Репликация и распределенные запросы также отключены для пользовательских экземпляров.Replication and distributed queries are also disabled for user instances.

Примечание

Пользовательские экземпляры не требуются для пользователей, которые уже являются администраторами на своих компьютерах, или для сценариев, включающих несколько пользователей базы данных.User instances are not needed for users who are already administrators on their own computers, or for scenarios involving multiple database users.

Programmability

Feature Enterprise Standard Web Express with Advanced Services Express
Basic R integration 1 Yes Yes Yes Yes No
Advanced R integration 2 Yes No No No No
Basic Python integration Yes Yes Yes Yes No
Advanced Python integration Yes No No No No
Machine Learning Server (Standalone) Yes No No No No
PolyBase compute node Yes Yes 3 Yes 3 Yes 3 Yes 3
PolyBase head node Yes No No No No
JSON Yes Yes Yes Yes Yes
Query Store Yes Yes Yes Yes Yes
Temporal Yes Yes Yes Yes Yes
Common Language Runtime (CLR) Integration Yes Yes Yes Yes Yes
Native XML support Yes Yes Yes Yes Yes
XML indexing Yes Yes Yes Yes Yes
MERGE & UPSERT capabilities Yes Yes Yes Yes Yes
FILESTREAM support Yes Yes Yes Yes Yes
FileTable Yes Yes Yes Yes Yes
Date and Time datatypes Yes Yes Yes Yes Yes
Internationalization support Yes Yes Yes Yes Yes
Full-text and semantic search Yes Yes Yes Yes No
Specification of language in query Yes Yes Yes Yes No
Service Broker (messaging) Yes Yes No (Client only) No (Client only) No (Client only)
Transact-SQL endpoints Yes Yes Yes No No
Graph Yes Yes Yes Yes Yes

1 Basic integration is limited to 2 cores and in-memory data sets.

2 Advanced integration can use all available cores for parallel processing of data sets at any size subject to hardware limits.

3 Scale out with multiple compute nodes requires a head node.

RDBMS manageability

Feature Enterprise Standard Web Express withAdvanced Services Express
User instances No No No Yes Yes
LocalDB No No No Yes No
Dedicated admin connection Yes Yes Yes Yes1 Yes1
SysPrep support2 Yes Yes Yes Yes Yes
PowerShell scripting support3 Yes Yes Yes Yes Yes
Support for data-tier application component operations — extract, deploy, upgrade, delete Yes Yes Yes Yes Yes
Policy automation (check on schedule and change) Yes Yes Yes No No
Performance data collector Yes Yes Yes No No
Able to enroll as a managed instance in multi-instance management Yes Yes Yes No No
Standard performance reports Yes Yes Yes No No
Plan guides and plan freezing for plan guides Yes Yes Yes No No
Direct query of indexed views (using NOEXPAND hint) Yes Yes Yes Yes Yes
Direct query SQL Server Analysis Services Yes Yes No No Yes
Automatic indexed views maintenance Yes Yes Yes No No
Distributed partitioned views Yes No No No No
Parallel indexed operations Yes No No No No
Automatic use of indexed view by query optimizer Yes No No No No
Parallel consistency check Yes No No No No
SQL Server Utility Control Point Yes No No No No
Buffer pool extension Yes Yes No No No
Master instance for big data cluster Yes Yes No No No
Compatibility certification Yes Yes Yes Yes Yes

1 With trace flag

2 For more information, see Considerations for Installing SQL Server Using SysPrep.

3 On Linux, PowerShell scripts are supported, from Windows computers targeting SQL Server on Linux.

SQL Server editions

The following table describes the editions of SQL Server.

SQL Server edition Definition
Enterprise The premium offering, SQL Server Enterprise edition delivers comprehensive high-end datacenter capabilities with blazing-fast performance, unlimited virtualization1, and end-to-end business intelligence — enabling high service levels for mission-critical workloads and end-user access to data insights.
Standard SQL Server Standard edition delivers basic data management and business intelligence database for departments and small organizations to run their applications and supports common development tools for on-premises and cloud — enabling effective database management with minimal IT resources.
Web SQL Server Web edition is a low total-cost-of-ownership option for Web hosters and Web VAPs to provide scalability, affordability, and manageability capabilities for small to large-scale Web properties.
Developer SQL Server Developer edition lets developers build any kind of application on top of SQL Server. It includes all the functionality of Enterprise edition, but is licensed for use as a development and test system, not as a production server. SQL Server Developer is an ideal choice for people who build and test applications.
Express editions Express edition is the entry-level, free database and is ideal for learning and building desktop and small server data-driven applications. It is the best choice for independent software vendors, developers, and hobbyists building client applications. If you need more advanced database features, SQL Server Express can be seamlessly upgraded to other higher end versions of SQL Server. SQL Server Express LocalDB is a lightweight version of Express that has all of its programmability features, runs in user mode and has a fast, zero-configuration installation and a short list of prerequisites.

1
Unlimited virtualization is available on Enterprise Edition for customers with Software Assurance. Deployments must comply with the licensing guide. For more information, see our pricing and licensing page.

Start LocalDB and connect to LocalDB

Connect to the automatic instance

The easiest way to use LocalDB is to connect to the automatic instance owned by the current user by using the connection string . To connect to a specific database by using the file name, connect using a connection string similar to .

The naming convention and connection string for LocalDB format changed in SQL Server 2014. Previously, the instance name was a single v character followed by LocalDB and the version number. Starting with SQL Server 2014, this instance name format is no longer supported, and the connection string mentioned previously should be used instead.

Note

The first time a user on a computer tries to connect to LocalDB, the automatic instance must be both created and started. The extra time for the instance to be created can cause the connection attempt to fail with a timeout message. When this happens, wait a few seconds to let the creation process complete, and then connect again.

Create and connect to a named instance

In addition to the automatic instance, LocalDB also supports named instances. Use the SqlLocalDB.exe program to create, start, and stop a named instance of LocalDB. For more information about SqlLocalDB.exe, see SqlLocalDB Utility.

The last line above, returns information similar to the following.

Category Value
Name
Version <Current Version>
Shared name «»
Owner «<Your Windows User>»
Auto create No
State running
Last start time <Date and Time>
Instance pipe name np:\\.\pipe\LOCALDB#F365A78E\tsql\query

Note

If your application uses a version of .NET before 4.0.2 you must connect directly to the named pipe of the LocalDB. The Instance pipe name value is the named pipe that the instance of LocalDB is listening on. The portion of the Instance pipe name after LOCALDB# will change each time the instance of LocalDB is started. To connect to the instance of LocalDB by using SQL Server Management Studio, type the instance pipe name in the Server name box of the Connect to Database Engine dialog box. From your custom program you can establish connection to the instance of LocalDB using a connection string similar to

Connect to a shared instance of LocalDB

To connect to a shared instance of LocalDB add (backslash + dot + backslash) to the connection string to reference the namespace reserved for shared instances. For example, to connect to a shared instance of LocalDB named use a connection string such as as part of the connection string. A user connecting to a shared instance of LocalDB that they do not own must have a Windows Authentication or SQL Server Authentication login.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector