Misunderstanding #7: A database may have multiple images
Error
This misunderstanding is quite common. Each primary server only supports one backup storage. If you want to have copies of multiple master servers, use transaction log transmission.
In the database, tables are very important. Most of the data is stored in tables. Operations on tables directly affect the data in the database! Below is my summary in this chapter!
Summary of this chapter! You can directly operate a table, or
SQL Server caches frequently used data in memory (that is, data page cache) to speed up data access. Because the disk access speed is much lower than the memory, reducing disk access volume is also an important aspect of database optimization.
This article explains how to extend the stored procedure of SQL Server database through examples to achieve remote backup and recovery.
Instance description:
Environment: Win2k + sqlserver 2 K + query AnalyzerSQL Server service instance name:
Misunderstanding #26: there is a real "transaction nesting" in SQL Server"Error
Nested transactions do not seem to allow transaction nesting as their syntax shows. I really don't know why some people write code like this. The only thing I can think
This series of articles I saw in the sqlskill.com's PAUL blog, many misunderstandings are more typical and representative, the original from the T-SQL Tuesday #11: Misconceptions about... EVERYTHING !!, Our team has translated and organized the
Misunderstanding #2: dbcc checkdb will cause blocking, because this command will lock by default
This is wrong!
In SQL Server 7.0 and earlier versions, the essence of dbcc checkdb commands is that the C language implements a continuously nested loop
What should we do if we need to modify the SQL server table structure? The following describes how to modify the SQL server table structure.
Add a varchar column to the SQL server table:Alter table distributors add column address varchar (30
-- View the foreign key constraints of a specified table
Select * from sysobjects where parent_obj in (
Select id from sysobjects where name = 'table name ')
And xtype = 'pk'
-- View All Tables
Select * from sysobjects where xtype = 'pk'
-- Delete
I. Create a database, create tables, and add constraints.
1.1 database creation
Copy codeThe Code is as follows: use master
Go
If exists (select * from sysdatabases where name = 'mydatabas')-determine whether the database name to be created exists
In this article, I will explain how to use SQL Server tools to optimize the use of database indexes. This article also involves general knowledge about indexes.
Common knowledge about Indexes
Index is the biggest factor affecting
I. Overview of Indexes
1. Concept: a database index is a structure that sorts the values of one or more columns in a data table, just like a directory in a book, indexes provide the ability to quickly query specific rows in rows.
2. Advantages and
Copy codeThe Code is as follows: create function fGetStrBySplit
(
@ Source VARCHAR (max ),
@ Index INT,
@ SplitChar VARCHAR (1)
)
RETURNS varchar (MAX)
AS
BEGIN
DECLARE @ Len INTDECLARE @ n INT = 0DECLARE @ ChIndex INTDECLARE @ Result
When designing a primary key, consider the following:
1. Meaningless: the meaning here is defined from the user's perspective. This meaningless solution also reduces database information redundancy to a certain extent. Some people often refer to
Copy codeThe Code is as follows: using System;
Using System. Data;
Using System. Configuration;
Using System. Web;
Using System. Web. Security;
Using System. Web. UI;
Using System. Web. UI. WebControls;
Using System. Web. UI. WebControls.
Copy codeThe Code is as follows: -- Begin Index analysis optimization related SQL
-- Returns the index with the current database fragmentation rate greater than 25%.
-- Run this statement to scan many data pages
-- Avoid running when the system load
Method 1:
Copy codeThe Code is as follows: truncate table TableName
When you delete all the data in the table, it is automatically increased and cleared.
If there is a foreign key to refer to this table, this method will report an error (even if
After attaching a database, you cannot view the database relationship diagram or establish a database relationship diagram.
My solution is as follows:
1. Set the compatibility level to 90 (2005 to 90) (2000 to 80)
Copy codeThe Code is as
No.
Standard landCode)
Segment encoding (sectCode)
1
131001BG001
G001
2
131001BG002
G001
3
131001BG003
G001
4
131001BG004
G002
5
131001BG005
G003
Now you need to
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.