Ms SQL SERVER: DDL triggers

Ms SQL Server: DDL trigger DDL trigger (this article is on the Network) 1. DDL trigger event summary:When creating an event notification to monitor and respond to activities in the database or server instance, you can specify the corresponding

How to modify an ID column in SQL Server

---- Allow updates to system tablesExec sp_configure 'Allow updates', 1Reconfigure with overrideGo ---- Unmark the ID columnUpdate syscolumns set colstat = 0 where id = object_id ('tablename') and colstat = 1Go -- Insert rows with ID = 8001-8003.

How to view the SQL Server version

  Address: http://www.cnblogs.com/jfzhu/archive/2012/11/23/2785100.html Reprinted please indicate the source   Method 1: (1) Open Microsoft SQL Server Management studio and connect to SQL Server (2) Right-click the SQL server root node and

SQL Server review-Index

Index cost 1. Added, changed, and deleted indexes are maintained. 2. Indexes occupy a certain amount of physical space   Indexing principles 1. The primary key must be indexed 2. Foreign keys must be indexed 3. It is best to create an index

SQL Server conver Method

The convert () function is a general function that converts a date to a new data type. The convert () function can display date/time data in different formats. Syntax: Convert (data_type (length), date_to_be_converted, style) Date_type

SQL Server uses the first letter of a Chinese character

Create Function fun_getpy(@ STR nvarchar (4000))Returns nvarchar (4000)AsBegin Declare @ word nchar (1), @ py nvarchar (4000) Set @ py ='' While Len (@ Str)> 0BeginSet @ word = left (@ STR, 1) -- If it is not a Chinese character, the original

Several Methods for deleting duplicate data in a table in SQL Server

    Method 1   Declare @ Max integer, @ ID integerDeclare cur_rows cursor local for Select Main field, count (*) from table name group by main field having count (*)> 1Open cur_rowsFetch cur_rows into @ ID, @ MaxWhile @

SQL Server multi-row data stitching

1. Table Structure ID Type Productcode 1 Pencil 0001 2 Pencil 0002 3 Pencil 0003 4 Pen 0004 5 Pen 0005 6 Pen

SQL statements commonly used by SQL Server to retrieve Repeated Records

Obtains the data of a field or several fields that have repeated entries.Select field1, field2 from Table group by field1, field2 having count (field1)> 1 Obtain the latest records with no repeated FieldsSelect top * from Table A where ID in

SQL Server obtains all tables, comments, and field attributes.

Retrieve table information   Select Sysobjects. Name, SYS. extended_properties.value From Sysobjects Left   Join SYS. extended_properties On Sysobjects. ID = SYS. extended_properties.major_id Where Type =   ' U

SQL Server operation excerpt

Use commands to create a userBelow is a simple example of adding a login account:Exec sp_addlogin 'pattern'RememberProgramUse the exec keyword before the name.The following is a complicated example of adding a new login account.Sp_addlogin 'sharonr',

SQL Server field type description

Field Type Description Bit 0Or an integer of 1. Int  Integer number from-2 ^ 31 (-2,147,483,648) to 2 ^ 31 (2,147,483,647) Smallint  Integer number from-2 ^ 15 (-32,768) to 2 ^ 15 (32,767)

SQL Server full-text index

The specific implementation scheme of SQL full-text in exchange for time at the expense of space is as follows:   1: Create full-text in the SQL script. [assume that the loginname field (nvarchar), displayname field (nvarchar), and properties

Uniqueidentifier data type in SQL Server

the uniqueidentifier data type can store 16-byte binary values, which act the same as the Globally Unique Identifier (guid. GUID is the unique binary number: No duplicate guid value is generated on any two computers in the world. in SQL,

Common SQL statements of SQL Server

Add foreign key constraints Alter table dbo. account_userrole add foreign key (userid)References DBO. account_user (userid) Delete Index Drop index [user_publish_ischeck] on [DBO]. [user_publish] Delete primary key Alter table user_publish

SQL Server Function Summary

Aggregate functions AVG (numeric_expr) returns integer, decimal, money, float --- returns the average value of each value in the groupCount (* | column_name | distinct column_name) returns integer --- number of records in the returned table |

SQL Server database job execution statement

Select J. Name job name, P. step_id step number, P. step_name step name, P. Command run command,Case J. EnabledWhen 0 then 'deactivated'When 1 then 'enabled'Else ''end status,Case P. last_run_outcomeWhen 0 then 'failed'When 1 then 'success'Else

SQL Server review-views and stored procedures

View A view is actually a query result of one or more tables. The view displays data in a centralized manner, facilitating your query. Advantages of a view: 1. Data Confidentiality 2. Simplified Query 3. Ensure logical independence of data

SQL Server review-constraints, default, rules

Constraints 1. Check Constraints 2. Default Constraints 3. primary key constraint (composite primary key, with multiple columns determining uniqueness) 4. Foreign key constraints 5. unique constraint (unique constraint) The foreign key

Application of RAID in SQL Server (RAID level)

Enterprise-levelDatabaseMost applications are deployed inRaidThe disk array server can improve the disk access performance and implement fault tolerance/disaster tolerance.RAID (redundant disk array) is simply an array made of cheap hard disks. The

Total Pages: 923 1 .... 729 730 731 732 733 .... 923 Go to: GO

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.