Скачивание sql server management studio (ssms)
Содержание:
- Initializing the Forge Class¶
- Creating and Dropping Tables¶
- Project Setup
- Cloud Deployment
- Connecting to MySQL or MariaDB instances
- Modifying Tables¶
- Creating and Dropping Tables¶
- Initializing the Forge Class¶
- Создание диаграмм
- Полное описание программы dbForge Studio for SQL Server
- Initializing the Forge Class¶
- Description
- What’s next in VS Code extension
- About Bojan Petrovic
- Manipulating Tables
- Подключение к базе данных
- Creating Tables
- Initializing the Forge Class¶
- Описание
Initializing the Forge Class¶
Important
In order to initialize the Forge class, your database
driver must already be running, since the forge class relies on it.
Load the Forge Class as follows:
$this->load->dbforge()
You can also pass another database object to the DB Forge loader, in case
the database you want to manage isn’t the default one:
$this->myforge = $this->load->dbforge($this->other_db, TRUE);
In the above example, we’re passing a custom database object as the first
parameter and then tell it to return the dbforge object, instead of
assigning it directly to .
Note
Both of the parameters can be used individually, just pass an empty
value as the first one if you wish to skip it.
Once initialized you will access the methods using the
object:
Creating and Dropping Tables¶
There are several things you may wish to do when creating tables. Add
fields, add keys to the table, alter columns. CodeIgniter provides a
mechanism for this.
Fields are created via an associative array. Within the array you must
include a ‘type’ key that relates to the datatype of the field. For
example, INT, VARCHAR, TEXT, etc. Many datatypes (for example VARCHAR)
also require a ‘constraint’ key.
$fields = array( 'users' => array( 'type' => 'VARCHAR', 'constraint' => '100', ), ); // will translate to "users VARCHAR(100)" when the field is added.
Additionally, the following key/values can be used:
- unsigned/true : to generate “UNSIGNED” in the field definition.
- default/value : to generate a default value in the field definition.
- null/true : to generate “NULL” in the field definition. Without this,
the field will default to “NOT NULL”. - auto_increment/true : generates an auto_increment flag on the
field. Note that the field type must be a type that supports this,
such as integer. - unique/true : to generate a unique key for the field definition.
$fields = array( 'blog_id' => array( 'type' => 'INT', 'constraint' => 5, 'unsigned' => TRUE, 'auto_increment' => TRUE ), 'blog_title' => array( 'type' => 'VARCHAR', 'constraint' => '100', 'unique' => TRUE, ), 'blog_author' => array( 'type' =>'VARCHAR', 'constraint' => '100', 'default' => 'King of Town', ), 'blog_description' => array( 'type' => 'TEXT', 'null' => TRUE, ), );
After the fields have been defined, they can be added using
$this->dbforge->add_field($fields); followed by a call to the
create_table() method.
$this->dbforge->add_field()
The add fields method will accept the above array.
Passing strings as fields
If you know exactly how you want a field to be created, you can pass the
string into the field definitions with add_field()
$this->dbforge->add_field("label varchar(100) NOT NULL DEFAULT 'default label'");
Note
Passing raw strings as fields cannot be followed by add_key() calls on those fields.
Note
Multiple calls to add_field() are cumulative.
Creating an id field
There is a special exception for creating id fields. A field with type
id will automatically be assigned as an INT(9) auto_incrementing
Primary Key.
$this->dbforge->add_field('id'); // gives id INT(9) NOT NULL AUTO_INCREMENT
Generally speaking, you’ll want your table to have Keys. This is
accomplished with $this->dbforge->add_key(‘field’). An optional second
parameter set to TRUE will make it a primary key. Note that add_key()
must be followed by a call to create_table().
Multiple column non-primary keys must be sent as an array. Sample output
below is for MySQL.
$this->dbforge->add_key('blog_id', TRUE); // gives PRIMARY KEY `blog_id` (`blog_id`) $this->dbforge->add_key('blog_id', TRUE); $this->dbforge->add_key('site_id', TRUE); // gives PRIMARY KEY `blog_id_site_id` (`blog_id`, `site_id`) $this->dbforge->add_key('blog_name'); // gives KEY `blog_name` (`blog_name`) $this->dbforge->add_key(array('blog_name', 'blog_label')); // gives KEY `blog_name_blog_label` (`blog_name`, `blog_label`)
After fields and keys have been declared, you can create a new table
with
$this->dbforge->create_table('table_name'); // gives CREATE TABLE table_name
An optional second parameter set to TRUE adds an “IF NOT EXISTS” clause
into the definition
$this->dbforge->create_table('table_name', TRUE); // gives CREATE TABLE IF NOT EXISTS table_name
You could also pass optional table attributes, such as MySQL’s ENGINE:
$attributes = array('ENGINE' => 'InnoDB'); $this->dbforge->create_table('table_name', FALSE, $attributes); // produces: CREATE TABLE `table_name` (...) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
Note
Unless you specify the CHARACTER SET and/or COLLATE attributes,
create_table() will always add them with your configured char_set
and dbcollat values, as long as they are not empty (MySQL only).
Execute a DROP TABLE statement and optionally add an IF EXISTS clause.
// Produces: DROP TABLE table_name $this->dbforge->drop_table('table_name'); // Produces: DROP TABLE IF EXISTS table_name $this->dbforge->drop_table('table_name',TRUE);
Project Setup
MongoDB database
Make sure your database collections look like below:
Once you are done, be sure to specify the connection string or in the configuration JSON file or as environment variables — see instructions in the next section for details.
If you would like run the sample w/o setting up MongoDB, see how to run the Extension Gallery as the backend in section later.
Environment Setup
Fill out the configuration JSON file here that matches your targeted environment mode (development or production).
For the production mode you can set up the below environment variables and will pick up.
- // Specify the MongoDB connection string here
- //Specify the MongoDB host name
- //Specify the MongoDB database name, leave empty if using connection string
- //Specify the MongoDB user name, leave empty if using connection string
- //Specify the MongoDB password, leave empty if using connection string
- //Specify the MongoDB host port, leave empty if using connection string
Client and Server
In development, the client is dynamically built by the
webpack-dev-middleware and both the backend and client needs to run in parallel in separate sessions:
- (downloads project dependencies locally)
- or (builds/runs server on the fly with or w/o monitoring code changes)
- Start a new CLI session and run (builds/runs client on the fly and monitors code changes)
In production, the client requires a build step, so run:
- (not required if you already run at previous step)
- (builds client)
- (run the server)
References
Model Schema:
{ "_id" : "mongoDB Id", "urn" : "model URN", "name" : "Model name", "path" : "...path of local svf for dev env ...", "env" : "AutodeskProduction" || "Local", "materialCategories": , "sequence" : [], "states" : [], "options" : { //extensions options }, "thumbnail" : "... base64 encoded thumbnail ... " }
Material Schema:
{ "_id" : ObjectId("57ee6b26dfda94c109157449"), "name" : "Steel", "supplier" : "Autodesk", "currency" : "USD", "price" : 2.5 }
An export of my database records is provided in
Cloud Deployment
It may be a bit tricky to deploy that sample in the Cloud because it requires two steps in order to be run:
1/ You need to translate at least one model using your own Forge credentials, so it can be loaded by your app. In order to do that take a look at the step-by-step tutorial from the Model Derivative API to understand exactly what this is about.
Once you have translated at least one model, take note of its URN, that’s the base64 encoded objectId. You also need a model which has some «Material» properties to be compatible with forge-rcdb because it is expecting components with that property. You can use Engine.dwf placed in the resource/models directory of this project.
2/ You need valid credentials to a MongoDB Cloud database that holds materials and models records. I suggest MongoDB Atlas or Compose MongoDB. With Atlas you can set up an account for free, that’s way enough for running multiple samples. Creating the database, with one user, will give you the credentials you need: dbname, dbhost, user, password and dbport.
Important: your database name needs to be «forge-rcdb», it is currently hardcoded in the sample, or you need to change that accordingly in the project config.
Import the two collections as ‘rcdb.materials’ and ‘rcdb.models’, then edit rcdb.model to replace the URN of your custom translated Engine.dwf model from step 1/
You should be ready to deploy to heroku, providing the same Forge credentials used to translate the model and valid credentials of the database when prompted for the environment settings.
Connecting to MySQL or MariaDB instances
The extension can be installed either from Marketplace, integrated extension manager inside Visual Studio Code, or using the VSIX installation file available as a download on this page. I’m gonna go with the integrated extension manager, but feel free to use any of the other two methods.
Bring up the Extensions view by clicking on the Extensions icon in the Activity Bar on the left side of code editor or go to View | Extensions from the main menu:
Start typing the name of the VS Code extension, and it should pop-up in the search results. At the moment of writing this article, the official product version is 2020.3.19. To install the extension, click the Install button shown below:
Once the installation is complete, you’ll see one additional icon in the Activity Bar. Clicking on the icon will bring up ApexSQL server explorer which is used for connecting to MySQL or MariaDB instances using TCP/IP or a local socket or pipe:
I’ve already added a few instances, as can be seen above, but let’s add another one by clicking on the plus (+) sign on the top right of connection explorer. This action will open the Connect to server tab in which I’ll enter needed information to connect to MySQL Server using TCP/IP over an SSH connection:
Once everything is set up, just click Connect, and if connection parameters are correct, you’ll see a message in the bottom right corner of Visual Studio Code saying “Connection successful”. The Connect to server tab closes, and the focus goes to ApexSQL server explorer in which you’ll find the newly added instance of MySQL Server:
Modifying Tables¶
$this->dbforge->add_column()
The method is used to modify an existing table. It
accepts the same field array as above, and can be used for an unlimited
number of additional fields.
$fields = array( 'preferences' => array('type' => 'TEXT') ); $this->dbforge->add_column('table_name', $fields); // Executes: ALTER TABLE table_name ADD preferences TEXT
If you are using MySQL or CUBIRD, then you can take advantage of their
AFTER and FIRST clauses to position the new column.
Examples:
// Will place the new column after the `another_field` column: $fields = array( 'preferences' => array('type' => 'TEXT', 'after' => 'another_field') ); // Will place the new column at the start of the table definition: $fields = array( 'preferences' => array('type' => 'TEXT', 'first' => TRUE) );
$this->dbforge->drop_column()
Used to remove a column from a table.
$this->dbforge->drop_column('table_name', 'column_to_drop');
Creating and Dropping Tables¶
There are several things you may wish to do when creating tables. Add
fields, add keys to the table, alter columns. CodeIgniter provides a
mechanism for this.
Fields are created via an associative array. Within the array you must
include a ‘type’ key that relates to the datatype of the field. For
example, INT, VARCHAR, TEXT, etc. Many datatypes (for example VARCHAR)
also require a ‘constraint’ key.
$fields = array( 'users' => array( 'type' => 'VARCHAR', 'constraint' => '100', ), ); // will translate to "users VARCHAR(100)" when the field is added.
Additionally, the following key/values can be used:
- unsigned/true : to generate “UNSIGNED” in the field definition.
- default/value : to generate a default value in the field definition.
- null/true : to generate “NULL” in the field definition. Without this,
the field will default to “NOT NULL”. - auto_increment/true : generates an auto_increment flag on the
field. Note that the field type must be a type that supports this,
such as integer. - unique/true : to generate a unique key for the field definition.
$fields = array( 'blog_id' => array( 'type' => 'INT', 'constraint' => 5, 'unsigned' => TRUE, 'auto_increment' => TRUE ), 'blog_title' => array( 'type' => 'VARCHAR', 'constraint' => '100', 'unique' => TRUE, ), 'blog_author' => array( 'type' =>'VARCHAR', 'constraint' => '100', 'default' => 'King of Town', ), 'blog_description' => array( 'type' => 'TEXT', 'null' => TRUE, ), );
After the fields have been defined, they can be added using
followed by a call to the
method.
$this->dbforge->add_field()
The add fields method will accept the above array.
Passing strings as fields
If you know exactly how you want a field to be created, you can pass the
string into the field definitions with add_field()
$this->dbforge->add_field("label varchar(100) NOT NULL DEFAULT 'default label'");
Note
Passing raw strings as fields cannot be followed by calls on those fields.
Note
Multiple calls to add_field() are cumulative.
Creating an id field
There is a special exception for creating id fields. A field with type
id will automatically be assigned as an INT(9) auto_incrementing
Primary Key.
$this->dbforge->add_field('id'); // gives id INT(9) NOT NULL AUTO_INCREMENT
Generally speaking, you’ll want your table to have Keys. This is
accomplished with $this->dbforge->add_key(‘field’). An optional second
parameter set to TRUE will make it a primary key. Note that add_key()
must be followed by a call to create_table().
Multiple column non-primary keys must be sent as an array. Sample output
below is for MySQL.
$this->dbforge->add_key('blog_id', TRUE); // gives PRIMARY KEY `blog_id` (`blog_id`) $this->dbforge->add_key('blog_id', TRUE); $this->dbforge->add_key('site_id', TRUE); // gives PRIMARY KEY `blog_id_site_id` (`blog_id`, `site_id`) $this->dbforge->add_key('blog_name'); // gives KEY `blog_name` (`blog_name`) $this->dbforge->add_key(array('blog_name', 'blog_label')); // gives KEY `blog_name_blog_label` (`blog_name`, `blog_label`)
After fields and keys have been declared, you can create a new table
with
$this->dbforge->create_table('table_name'); // gives CREATE TABLE table_name
An optional second parameter set to TRUE adds an “IF NOT EXISTS” clause
into the definition
$this->dbforge->create_table('table_name', TRUE); // gives CREATE TABLE IF NOT EXISTS table_name
You could also pass optional table attributes, such as MySQL’s :
$attributes = array('ENGINE' => 'InnoDB'); $this->dbforge->create_table('table_name', FALSE, $attributes); // produces: CREATE TABLE `table_name` (...) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
Note
Unless you specify the and/or attributes,
will always add them with your configured char_set
and dbcollat values, as long as they are not empty (MySQL only).
Execute a DROP TABLE statement and optionally add an IF EXISTS clause.
// Produces: DROP TABLE table_name $this->dbforge->drop_table('table_name'); // Produces: DROP TABLE IF EXISTS table_name $this->dbforge->drop_table('table_name',TRUE);
Initializing the Forge Class¶
Important
In order to initialize the Forge class, your database
driver must already be running, since the forge class relies on it.
Load the Forge Class as follows:
$this->load->dbforge()
You can also pass another database object to the DB Forge loader, in case
the database you want to manage isn’t the default one:
$this->myforge = $this->load->dbforge($this->other_db, TRUE);
In the above example, we’re passing a custom database object as the first
parameter and then tell it to return the dbforge object, instead of
assigning it directly to .
Note
Both of the parameters can be used individually, just pass an empty
value as the first one if you wish to skip it.
Once initialized you will access the methods using the
object:
Создание диаграмм
Этот режим полезен для разработки структуры MySQL баз. Вы можете либо добавлять новые таблицы на диаграмму, создавать поля и устанавливать связи, либо сформировать диаграмму из существующих таблиц. Последний вариант удобно использовать для подготовки документации и статей для блога
Обратите внимание. При создании связей между таблицами на диаграмме у вас есть возможность получить запрос, который эту связь создаёт
Для этого нажмите кнопку «Скрипт изменений» (показана на скриншоте).
Для данного примера вы получите следующий скрипт:
USE workshop; -- -- Изменить таблицу "table2" -- ALTER TABLE table2 ADD CONSTRAINT FK_table2_table1_id FOREIGN KEY (t_id) REFERENCES table1(id) ON DELETE NO ACTION ON UPDATE NO ACTION;
Полное описание программы dbForge Studio for SQL Server
Основные возможности Studio for SQL Server:
— Помощник для написания SQL-кода. — Дизайнер таблиц позволяет настраивать, редактировать и пересоздавать таблицы. — Диаграмма базы данных даёт точное отображение основных объектов и их связей. — Отладчик T-SQL — инструмент для разработки серверной логики. — Редактор данных облегчает работу с табличными данными. — Отчеты по данным, 9 различных форматов, возможность настроить автоматическую рассылку отчетов. — Сравнение данных — средство для переноса данных между серверами. — Экспорт и импорт данных. — Профилировщик запросов. — Дизайнер запросов. — Сравнение схем. — Сводные таблицы. — Менеджер безопасности. — Администрирование: резервное копирование, восстановление, копирование, присоединение, отсоедиенение БД.
Название приложения:Автор/Разработчик:Версия/сборка:Дата обновления: Размер скачиваемого файла:Операционная система:Наличие русского языка:Распространяется: | dbForge Studio for SQL Serverwww.devart.com 5.8.107 free ru 2019-10-26 113 МБ Windows 10, 8, 7 русскийбесплатно (Free) |
Скачать dbForge Studio for SQL Server free
виртуальный магазин компании Epic Games с масштабными и качественными играми для ПК и Mac.
2019-09-03 Giada
компактная бесплатная аудиостудия диджеев и электронных музыкантов для создания качественной музыки.
2018-06-26 Scratch
бесплатная программа для создания игр и анимации без навыка программирования.
Будем рады видеть Вас в наших группах!
Контакты | Пользовательское соглашениеВнимание! Находясь на данном сайте, вы подтверждаете свое согласие на сбор метаданных. Сайт создан в 2011
Все права защищены.
Широкий выбор решений обеспечения доступа к данным для различных технологий
Сообщество
Присоединяйтесь к нашему сообществу технических экспертов. Узнайте что-то новое или поделитесь своим опытом.
dbForge Studio for SQL Server
Initializing the Forge Class¶
Important
In order to initialize the Forge class, your database
driver must already be running, since the forge class relies on it.
Load the Forge Class as follows:
$this->load->dbforge()
You can also pass another database object to the DB Forge loader, in case
the database you want to manage isn’t the default one:
$this->myforge = $this->load->dbforge($this->other_db, TRUE);
In the above example, we’re passing a custom database object as the first
parameter and then tell it to return the dbforge object, instead of
assigning it directly to .
Note
Both of the parameters can be used individually, just pass an empty
value as the first one if you wish to skip it.
Once initialized you will access the methods using the
object:
Description
This is Forge Responsive Connected Database: A responsive React-based web application that showcases the use of Autodesk Forge Viewer and Forge web services, working in a connected environment with integrated data from multiple databases.
This sample uses Viewer v7, Babel v7, React v16, Redux v4, Bootstrap v3, jQuery v3, and Webpack v4, and serves as a reference sample for building Viewer apps with popular front end stacks like React/Bootstrap/Webpack etc. as well.
** If you are only interested in the extensions/plugins alone or would like to run this sample w/o MongoDB, see library-javascript-viewer-extensions **
What’s next in VS Code extension
I’m particularly looking forward to the upcoming formatting feature in this VS Code extension planned for the 2020 R4 version. It will allow users to format MySQL and MariaDB scripts using a predefined profile. ApexSQL has been well known for its SQL formatter tool for SQL Server.
Looking at the roadmap, each new version of the VS Code extension will bring something to the table. It’s nice to see that they are slowly expanding MySQL front by adding features from popular MS SQL tools to this product as well.
This means that a data search is also coming up, and it will allow users to quickly find data in MySQL and MariaDB databases. However, I’m more excited about the browsable visual hints list while typing AKA IntelliSense. This will speed coding up by inserting keywords, databases, schemas, objects, parameters, variable names, etc. So, stay tuned, and for more information, visit the ApexSQL Database Power Tools for VS Code extension product page.
About Bojan Petrovic
Bojan aka “Boksi”, an AP graduate in IT Technology focused on Networks and electronic technology from the Copenhagen School of Design and Technology, is a software analyst with experience in quality assurance, software support, product evangelism, and user engagement.
He has written extensively on both the SQL Shack and the ApexSQL Solution Center, on topics ranging from client technologies like 4K resolution and theming, error handling to index strategies, and performance monitoring.
Bojan works at ApexSQL in Nis, Serbia as an integral part of the team focusing on designing, developing, and testing the next generation of database tools including MySQL and SQL Server, and both stand-alone tools and integrations into Visual Studio, SSMS, and VSCode.
See more about Bojan at LinkedIn
View all posts by Bojan Petrovic
Manipulating Tables
Parameter | Type | Description |
---|---|---|
$table | The name of the table to drop | |
Returns | The result of the query |
Execute a statement with an clause:
Parameter | Type | Description |
---|---|---|
$table_name | The name of the table being renamed | |
$new_table_name | The new table name | |
Returns | The result of the query |
Executes a rename:
Parameter | Type | Description |
---|---|---|
$table | The table to add the column to | |
$field | The column defintition (see for details) | |
$after_field | The field that should come before this new field, leave empty to be the last field | |
Returns | The result of the query |
The method is used to modify an existing table. It accepts the same field array as above, and can be used for an unlimited number of additional fields:
You can also take advantage of MySQL’s and clauses to position the new column:
Parameter | Type | Description |
---|---|---|
$table | The table to drop the column from | |
$column_name | The name of the column to drop | |
Returns | The result of the query |
Used to remove a column from a table:
Parameter | Type | Description |
---|---|---|
$table | The table to add the column to | |
$field | The column defintition (see for details) | |
Returns | The result of the query |
The usage of this method is identical to , except it alters an existing column rather than adding a new one. In order to change the name you can add a key into the field defining array:
Подключение к базе данных
Тут очень важно, чтобы была возможность подключиться через SSH. Если её нет, то должны быть другие, очень веские причины для использования такого MySQL менеджера
Конечно, вы можете открыть доступ к MySQL серверу снаружи, но при этом придётся обеспечивать его безопасность (например, создавать списки IP адресов, с которых можно к нему подключаться), а это дополнительная работа.
В dbForge подключение через SSH реализовано, нужные настройки находятся на вкладке «Безопасность».
Примечание. Скриншоты для этой статьи я сделал с локального сервера, установленного в VirtualBox, поэтому использована аутентификация с помощью пароля. Для рабочих серверов лучше использовать ключи и запретить вход под root’ом.
Creating Tables
There are several things you may wish to do when creating tables. Add fields, add keys to the table, alter columns. CodeIgniter provides a mechanism for this.
Parameter | Type | Description |
---|---|---|
$field | A multiddimensional associative array containing field names as the keys and an associative array of parameters for creating database fields: : The type of field to create (e.g. , , ) : The length of the field : Set to to generate in the field definition. : Set to a value to generate a default value in the field definition. : Set to to generate in the field definition. Without this, the field will default to . : Set to to generate an flag on the field. Note that the field type must be a type that supports this, such as integer. | |
Returns |
Fields are created via an associative array. Within the array you must include a key that relates to the datatype of the field. For example, , , , etc. Many datatypes (for example ) also require a key.
Additionally, the following keys can be used:
- : Set to to generate in the field definition.
- : Set to a value to generate a default value in the field definition.
- : Set to to generate in the field definition. Without this, the field will default to .
- : Set to to generate an flag on the field. Note that the field type must be a type that supports this, such as integer.
After the fields have been defined, they can be added using followed by a call to the method.
Passing strings as fields
If you know exactly how you want a field to be created, you can pass the string into the field definitions with :
Note: Multiple calls to are cumulative.
Creating an id field
There is a special exception for creating id fields. A field with type id will automatically be assinged as an Primary Key:
Parameter | Type | Description |
---|---|---|
$key | The name of the field to create a key for | |
$primary | Set this to to make the key a primary key | |
Returns |
Generally speaking, you’ll want your table to have Keys. This is accomplished with . An optional second parameter set to TRUE will make it a primary key. Note that must be followed by a call to .
Multiple column non-primary keys must be sent as an array. Sample output below is for MySQL.
Parameter | Type | Description |
---|---|---|
$table | The name of the table to create | |
$if_not_exists | Set to to only create the table if it does not exist | |
Returns | The result of the query |
After fields and keys have been declared, you can create a new table with:
An optional second parameter set to adds an clause into the definition:
You could also pass optional table attributes, such as MySQL’s :
Note: Unless you specify the and/or attributes, will always add them with your configured and values, as long as they are not empty (MySQL only).
Initializing the Forge Class¶
Important
In order to initialize the Forge class, your database
driver must already be running, since the forge class relies on it.
Load the Forge Class as follows:
$this->load->dbforge()
You can also pass another database object to the DB Forge loader, in case
the database you want to manage isn’t the default one:
$this->myforge = $this->load->dbforge($this->other_db, TRUE);
In the above example, we’re passing a custom database object as the first
parameter and then tell it to return the dbforge object, instead of
assigning it directly to .
Note
Both of the parameters can be used individually, just pass an empty
value as the first one if you wish to skip it.
Once initialized you will access the methods using the
object:
Описание
Программа установки LocalDB использует программу для установки необходимых файлов на компьютере. После установки LocalDB становится экземпляром SQL Server Express, который способен создавать и открывать базы данных SQL Server. Файлы системной базы данных, как правило, хранятся в каталоге AppData, который обычно скрыт. Например, . Файлы пользовательской базы данных хранятся в месте, указанном пользователем, как правило, в папке .
Дополнительные сведения о включении LocalDB в приложении см. в статье с общими сведениями о локальных данных в Visual Studio и статье о создании базы данных и добавлении таблиц в Visual Studio.
Дополнительные сведения об API LocalDB см. в разделе Справочник по SQL Server Express LocalDB.
Служебная программа позволяет создавать новые экземпляры LocalDB, запускать и останавливать работу экземпляров, а также использовать функции для управления LocalDB. Дополнительные сведения о служебной программе см. в разделе Программа SqlLocalDB.
Параметры сортировки для LocalDB заданы в и не могут быть изменены. Параметры сортировки на уровне базы данных, на уровне столбца и на уровне выражения поддерживаются обычным образом. Автономные базы данных следуют правилам метаданных и параметрам сортировки , определенным Contained Database Collations.
Ограничения
-
Невозможно применить исправление LocalDB без пакетов обновления. Накопительные пакеты обновления и обновления системы безопасности нельзя применить вручную или с помощью Центра обновления Windows, Центра обновления Windows для бизнеса или других способов.
-
Нельзя управлять LocalDB удаленно с помощью SQL Management Studio.
-
LocalDB не может быть подписчиком в репликации слиянием.
-
LocalDB не поддерживает FILESTREAM.
-
Для LocalDB разрешены только локальные очереди компонента Service Broker.
-
Экземпляр LocalDB, принадлежащий встроенным учетным записям, например , может иметь проблемы с управляемостью из-за перенаправления файловой системы Windows. Вместо этого следует использовать обычную учетную запись Windows в качестве владельца.
Автоматические и именованные экземпляры
LocalDB поддерживает два типа экземпляров: автоматические и именованные.
-
Автоматические экземпляры LocalDB являются общедоступными. Они создаются и обслуживаются автоматически и могут использоваться любым приложением. Для каждой версии LocalDB, установленной на компьютере пользователя, существует один автоматический экземпляр LocalDB. Автоматические экземпляры LocalDB обеспечивают удобное управление экземплярами. Нет необходимости создавать экземпляр. Он просто работает. Эта функция упрощает установку приложения и его перенос на другой компьютер. Если на целевом компьютере установлена указанная версия LocalDB, то там также будет доступен автоматический экземпляр LocalDB для этой версии. Автоматические экземпляры LocalDB именуются по специальному шаблону, принадлежащему зарезервированному пространству имен. Это позволяет избежать конфликтов имен с именованными экземплярами LocalDB. Автоматический экземпляр имеет имя MSSQLLocalDB.
-
Именованные экземпляры LocalDB являются закрытыми. Они принадлежат одному приложению, которое отвечает за создание экземпляра и управление им. Именованные экземпляры обеспечивают изоляцию от других экземпляров и способствуют повышению производительности за счет снижения уровня конфликта за ресурсы с другими пользователями базы данных. Пользователь должен создавать именованные экземпляры явным образом с помощью API управления LocalDB или неявным образом через файл app.config управляемого приложения (при необходимости управляемое приложение также может использовать API). Каждый именованный экземпляр LocalDB имеет связанную с ним версию LocalDB, которая указывает на соответствующий набор двоичных файлов LocalDB. Имя экземпляра LocalDB имеет тип данных sysname и может содержать до 128 символов. (в отличие от обычных именованных экземпляров SQL Server, где допускается использование только обычных имен NetBIOS из 16 символов ASCII). Имя экземпляра LocalDB может содержать любые символы Юникода, допустимые в имени файла. Именованный экземпляр, который использует имя автоматического экземпляра, становится автоматическим экземпляром.
Разные пользователи одного и того же компьютера могут иметь экземпляры с одинаковыми именами. Каждый экземпляр является отдельным процессом, который запускается от разных пользователей.