Skilled use of various usage methods in SQL Server can bring a lot of convenience to queries. Let's introduce except and intersect today. Note This syntax is supported only for SQL Server 2005 and later version numbers.Except refers to the data that
1. Access other local databases--Enable ad Hoc distributed queries--execsp_configure'Show advanced Options',1Reconfigureexecsp_configure'Ad Hoc Distributed Queries',1Reconfigure--Close AD Hoc distributed queries--When you are finished
Analyze the performance and flaws of the SQL Server Synchronization tool you wrote1. C # Synchronous SQL Server database schema2. C # Synchronizing data in a SQL Server database--Database synchronization tool [synchronizing new data]By testing the
Create a stored procedure under the master database as follows:Createproc Killspid (@dbnamevarchar( -)) asbeginDeclare@sqlnvarchar( -)Declare@spidintSet@sql='declare getspid cursor for select spid from sysprocesses where dbid in (select dbid from
1. Using CursorsDECLARE @sql varchar ( $), @name varchar ( +) DECLARE my_cursor scroll cursor for SelectName fromsysobjectswhereType ='u'and name like'jobs_%'Open My_cursorfetch Next frommy_cursor into @name while(@ @fetch_status =0) BEGIN
In SQL Server, the common table-to-table inner Join,outer Join is executed by the engine based on the selected column, the data is indexed, and the selected data is selectively converted to loop Join,merge Join,hash Join one of the three physical
1. Get the maximum number of simultaneous user connections allowed by SQL Server
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->SELECT @ @MAX_CONNECTIONS 2. Get connection information for the
Translated from: http://blog.chinaunix.net/uid-7953959-id-2543262.htmlTransaction log files Transaction log file is a file that is used to record database updates, with an extension of ldf.In SQL Server 7.0 and SQL Server , the transaction log files
Begin:Start transaction; # Be sure to have this '; ' number.Attention:MYSQL uses snapshot isolation, which means that a connection can be queried when it is modified.Example:CREATE TABLE T1 (X int);Insert into T1 (X) values (100);Connect A,Start
The following procedure is performed under Win 2003 SP2 + IIS 6.0, ASP. NET 2.0, SQL Server 2005.1. Installing the Session DatabaseTo the Framework directoryC:\WINDOWS\Microsoft.NET\Framework\v2.0.50727Run the following
In the data we often encounter ntext large text type, this type if and nvarchar type addition can have problems, so there is a way to solve this problem.SQL functions used:TEXTPTR: Returns the value of the text pointer to the textual, ntext, or
Some experiments are often like the use of English windows and SQL Server, but sometimes need to use the Chinese environment for easy understanding. The Chinese SQL Server cannot be installed on the English Windows system.The following compatibility
Relational: Use a relationship to represent the connection between entity information and entitiesRelationship: is a two-dimensional table with rows and columns of tablesCreating database: Create library name; fault level creation: CREATE database
1, determine whether there is addonearticle this stored procedureIf Exists (select name from sysobjects where name = ' addonearticle ' and type= ' P ')drop procedure Addonearticle2, determine whether there is countar this triggerif exists (SELECT *
Background knowledge:If you want to see the "Three Kingdoms" This TV show it has assumed that it is 400G so big, now you have two friends they have saved the play on their hard drive.A with a hard drive to save the play, B with two hard disk to save
The default DBCC CHECKDB only do database detection database is intact, do not actively do database repair, to repair the database, the database needs to set up a single mode.1. Repair_allow_data_loss may result in loss of data.2, Repair_fast did
1. Database:(1) sp_helpdb: Reports information about a specified database or all databases.Example: sp_helpdb--Display all database information (name, size, etc.)Example: sp_helpdb Recruitment--Display recruitment database information (name, size,
Triggers can do a lot of things, but it also brings a lot of problems. The trick to using it is to use it at the right time, rather than using it at an inappropriate time.Some common uses for triggers are as follows:
Elastic referential
One, trigger definition and creation:A trigger (trigger) is a special stored procedure whose execution is not invoked by the program or manually, but is triggered by an event, such as when an operation on a table (insert,delete,update) activates it
CREATE TABLE Tb_name(ID INT not NULL IDENTITY PRIMARY KEY,Title NVARCHAR (+) NULL)View the columns in the Tb_name table that are self-growingSELECT TOP (1) identitycol from Tb_nameView the current value of the self-growing column in the Tb_name
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.