How to create a database on a network share
If for any reason you need to place the database on a network share and by default this option is off you can follow the way described below:
A database on a network share is created by running T-sql script, graphic mode will not work in this case.
So, first we enable 1807 trace flag:
DBCC TRACEON(1807, -1)
go
Then run the script for database creation:
-- CREATE DATABASE [db]
ON PRIMARY
( NAME = N'db', FILENAME = N'\\DB\data\db_data.mdf' , SIZE = 5120KB , FILEGROWTH = 10024KB )
LOG ON
( NAME = N'db_log', FILENAME = N'\\DB\data\db_log.ldf' , SIZE = 1024KB , FILEGROWTH = 10%)
GO
The database has been successfully created.
In such a way we create a database on a network share.
The important moments you need to remember are
- when you create a database consider the rights MS SQL Server account has on this network share
- as long as speed access via LAN and reliability of such connection type are lower compared to standard location of databases, it is recommended to use such method for creation oftest databases or not vital systems.
This stuff was tested in MS SQL Server 2008R2 and 2012.
Utilizing given approach each client get his own database. In such case every client`s data stays isolated from others. It simplifies backing up the data, installing new clients but causes higher cost of maintenance.
MoreSubject recursion is well covered in the literature, but, nevertheless, the problem of output “tree” does not mean the client and SQL Server many baffled. So, put the problem: there is a table with the name and record id field indicating the parent identifier. Immediately fill in this table, some sort of test data:
MoreIn our time of greatest prevalence of databases were relational databases, which are the main targets of the tables and the relationships between them. Tables can solve most problems for data storage and manipulation. But in the real world entity requiring storage is not always presented in a tabular form. One of these very common types of data structures other than the table is a tree structure, where each data element is the parent and the offspring. An example of such a structure may be the structure of state enterprises, which is headed by the director (the root of the tree), his deputies, heads of departments from which are subject to certain deputies, employees of departments, which are subject to the rulers.
MoreSubscribe to our blog
Utilizing given approach each client get his own database. In such case every client`s data stays isolated from others. It simplifies backing up the data, installing new clients but causes higher cost of maintenance.
Subject recursion is well covered in the literature, but, nevertheless, the problem of output “tree” does not mean the client and SQL Server many baffled. So, put the problem: there is a table with the name and record id field indicating the parent identifier. Immediately fill in this table, some sort of test data:
Discuss your project with us