Method 1:1. Stop the source database and copy the two physical files (MDF and log) of the database to the destination.2. Open the Enterprise Manager of the target SQL Server database and append the database file as a local database. However, you
-- Attach a database
Sp_attach_db 'database name', 'database full path', 'database log full Path'GoUse Database Name-- Specify the default database before adding a login
Exec sp_addlogin 'login name', 'Password', 'database name'Go-- Grant this
A primary key is used to force the uniqueness of a field or a combination of multiple fields, and the field value cannot be null. Only one primary key constraint can be set in a table, but a combination of fields containing multiple fields can be
1. Stop all services
2. Use the Windows install clean up tool to uninstall the SQL 2005 component.
3.use srvinstw.exe to delete all SQL services
4. Clear the Registry
A. Delete all Microsoft SQL Server folders under HKEY_
Ms SQL Server Log File slimming
Organizations use asp net forums free forum SQL Server 20002 years later, the log file is fully loaded with 7 multi-GB hard disks (an oracle test server is also installed on the same server)
If you want to delete
The dynamic memory allocation mechanism introduced by SQL Server 2000 is generally unable to recycle the memory well, especially on the website server. A period of time may cause excessive memory consumption on the machine. If the computer is not
Set and use database replication on SQL Server 2000
Concept of ReplicationReplication is a technology that copies a set of data from one data source to multiple data sources. It is an effective way to publish a set of data to multiple storage
SMOIs the abbreviation of SQL Mangagement objects. It corresponds to ADO. net.
However, the difference is that ADO. NET is used for data access, whileSMO is designed, Although SMO can execute arbitrary SQL statements on the server.
Another
This was found in a post on csdn. I used it and turned it around.
Libin_ftsafe)
Create a job using a script:Bytes -------------------------------------------------------------------------------------
If exists (select * From DBO. sysobjects where
Transaction and error check
The most important knowledge of SQL Server is transactions, such as many OLTP (online transaction processing) applications. What is a transaction? A transaction is a collection of SQL statements. Transactions
The service in the "logging management tool" finds that the sqlserver.exe service is run by special users for the sake of server security: My computer-control panel-management tools-services-right-click MSSQLServer-properties-login identity
(If it
1. Enter the Enterprise Manager of Microsoft SQL Server.2. Select the database for which you want to restore Data, right-click the database, and select all tasks from the context menu to restore the database.3. Select recover database from the
When I was doing Oracle, PL/SQL developer could easily debug and write the stored procedure. Recently, when I tried to write the stored procedure of SQL Server, it was just a bit of a black, it cannot be debugged. I really don't know if the stored
The query result can contain data from multiple tables or table value objects. To combine data from multiple Table value objects, you can use the SQL join operation.
Automatic table join
When two or more tables are added to a query, the query
If exists (
Select *
From DBO. sysobjects
Where id = object_id (n' [DBO]. [sp_check_qq] ')
And objectproperty (ID, n' isprocedure ') = 1
)
Drop procedure [DBO]. [sp_check_qq]
Go
Create procedure DBO. sp_check_qq
-- Used to check whether all QQ
For database applications, database security is crucial. SQL Server's security function can protect data from unauthorized leaks and tampering! Below is a summary of the security chapter!
The first is a summary of the security object! Let's take a
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.