-- Create Test Database
Create database Test
On primary
(
Name = 'test _ data. mdf ',
Filename = 'd: Test_data.mdf'
)
Log on
(
Name = 'test _ data. ldf ',
Filename = 'd: Test_data.ldf'
)
-- Create a test table
Create table Test. dbo. ta (id
When running SQL Server on the Server, we always need to try our best to protect SQL Server from illegal user intrusion, deny access to the database, and ensure data security. SQL Server provides powerful built-in security and data protection to
We can maintain multiple copies of multiple data on different database servers through data replication across the LAN and the Internet, and ensure data consistency between copies in synchronous or asynchronous mode.
SQL Server provides
SQL Server supports two BACKUP methods: one is to use BACKUP DATABASE to back up DATABASE files, and the other is to directly copy DATABASE files mdf and log files ldf. In this article, we will mainly introduce the backup and recovery of the latter.
The first thing you need to do is to make sure that xp_cmdshell is available. You can choose one of the following two methods to achieve this.
1. You can use sp_configure and execute the following script.
EXEC master.dbo.sp_configure '
The logical design of databases is a wide range of issues. This article focuses on the primary key design issues and corresponding solutions when designing tables on ms SQL Server during application development.
Primary Key design status quo and
We only want a computer with an IP address to connect to the SQL Server server. Other clients are not allowed to connect. How can this problem be solved?Solution: You can set limits on the firewall to only allow 1433 communication with the specified
When executing the database creation script, the original database is often dropped first. Because SqlServer does not allow the execution of the drop database operation when detecting a data connection, the database creation script often fails to be
I took over an optimization project in the previous section, which requires that the company optimize the indexes of more than existing tables to improve the existing ones and eliminate invalid indexes. In view of the serious shortage of manpower
The following describes how to sum Multiple SQL fields and use them as SQL query conditions for your reference. I hope to help you learn SQL query.
Make a small SQL query for field summation and query the results in a table where the sum of Field 1,
(1)1. Search for redundant duplicate records in the Table. duplicate records are determined based on a single field (peopleId ).Select * from peopleWhere peopleId in (select peopleId from people group by peopleId having count (peopleId)> 1)2. Delete
SQL Server Management, do you do well? The following may be helpful to your work.
1. database files include. mdf. ndf. ldf files: mfd is the master database file, ndf is the slave database file, ldf is the log database file, each database mdf file
Before talking about the lock mechanism of SQL Server, let's think about the following scenario: When you ride your own car to your destination during the hot summer, there are several long red lights on the road, is it depressing? Sometimes you may
For injection, error messages are extremely important. The so-called error prompt refers to the feedback of different results from the correct page. Experts attach great importance to this point, which is crucial for precise judgment of injection
The Replace keyword is mainly used to Replace a character in a string with another character. Today we will introduce you to use it to check whether a specific string is contained. The sample code is as follows, if you are interested, refer
In SQL
Execute I believe everyone is familiar with it. It is abbreviated as exec. In addition to executing stored procedures, it is generally used to execute dynamic SQL statements.
New system stored procedures introduced in sp_executesql and sql2005 are
The knowledge about the MySQL database thread buffer pool is what we will introduce in this article. MySQL database supports thread caching. In multi-threaded connection mode, if the connection is closed, put this thread in the idle thread buffer.
In many new enterprise system designs implemented using SQL Server, system designers need to make key decisions on the positioning of data structures and management application logic. SQL Server has its own programming language (Transact-SQL, TSQL).
In an ideal world, there will be no database corruption, just as we will not include some serious accidents in our daily lives. Once such a thing happens, it will definitely have a very significant impact on our lives. This is also true in SQL
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.