The reason for this problem is that a user is connected to a database that is currently being restored, and the user here even includes the user who is currently being restored. The workaround is to close all connections to the database you want to
As follows:
Copy Code code as follows:
CREATE FUNCTION [dbo]. [Udf_daysinmonth]
(
@Date DATETIME
)
RETURNS INT
As
BEGIN
DECLARE @dim as TABLE (M int,dy INT)
INSERT into @dim VALUES
(1,31), (3,31), (5,31), (7,31), (8,
We know that SQL Server data row storage has two kinds of data structure: A: Heap b:b tree (binary two fork tree)
Data is sorted and stored in one of two ways, and friends who have studied data structures should know how to use binary trees,
Myth #27: Use Backup ... With checksum can replace DBCC CheckDB
Error
At first glance, because backup with checksum detects the value of the checksum for all assigned pages, this myth seems to be the case, but it's not really the case, for the
Sample script that is displays all of the users in a given SQL Server DB.
Supported platforms
SQL Server 2000
Yes
Script Code
Copy Code code as follows:
strdbservername = "."
strdbname = "Scriptingguystestdb"
A trigger is a special type of stored procedure that differs from the stored procedure we described earlier. Triggers are triggered primarily by events that are automatically invoked to execute. Stored procedures can be invoked by the name of the
Why Use Transactions
When more than one table is updated, an execution of the article fails. In order to maintain the integrity of the data, transaction rollback is required.
Show settings transaction
Copy Code code as follows:
Begin
In fact, I've already had articles detailing page checksums: How do I tell if the IO subsystem is causing corruptions?
Misunderstanding #17: Several misunderstandings about page checksum
The basics of the spread are wrong.
Pages checksum (page
The basic algorithm for automatically updating statistics is:
· If the table is in the tempdb database table the cardinality is less than 6, automatically updated to the table for each of the six modifications.
· If the base of the table is greater
The way to upload Excel data to SQL Server requires a three point notice!
Note: To upload Excel data to SQL Server, Excel must be uploaded to the server in advance.Practice: In the asp.net environment, add a fileupload upload control
e.x of the
There are many ways to implement synchronization between table data, such as deleting and then insert again, or writing some other branch conditions to determine whether to insert or UPDATE. The synchronization between table data can also be
When you insert multiple rows of data, you do not have to write more than n insert INTO.
SELECT DISTINCT ' (' + ' "' +loginip + ' + ') ' + ', ' from dbo. Login
WHERE LoginName in
(
SELECT DISTINCT loginname from dbo. Login
WHERE loginip= ' 61.17
I/O performance diagnostics
SQL Server performance is very dependent on the I/O subsystem. Unless your database is fit for physical memory, SQL Server often has database pages in and out of the cache pool. In this way, the actual I/O traffic occurs.
Simple Introduction
First Open SQLSERVER2012 's SSMs, click Open Admin-"extended Event-" session
In the session folder, click on the right button-to create a new session/new Session Wizard
In an existing session, right-click-Start session,
SharePoint 2013 farms are not allowed to appear in connection addresses that contain port numbers, otherwise the farm configuration will error, and cannot be completed when executing to the configuration farm database.
If SQL Server is not using
Method One
1. Create a new database with the same name
2. Stop SQL Server again (be careful not to detach the database)
3. Overwrite the new database with the data file of the original database
4. Restart SQL Server
5. When you open Enterprise
Recently, the following project encountered an urgent problem, my old horse and young people to fight together. The problem is that many queries are incredibly slow when the pressure data is poured into the database.
Said there must be some basic
The row was not found at the Subscriber when the error "Apply replicated command" occurred in SQL Server replication. The previous practice is to delete this copy, and then create a new copy, but this time, I suddenly want to Baidu to see how others
The concept of SQL Server 2000 replication: A set of techniques for replicating and distributing data and database objects between databases and synchronizing them to ensure their consistency.
With replication, you can distribute data to different
In SQL Server Case...end statements, there are generally two ways to use:1, equivalent to C # in If...else, example:1 SelectCName, Title= Case2 whenClevel='A1' Then 'Junior Programmer'3 whenClevel='A2' Then
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.