Differences between SQL Server 2000 @ identity, scope_identity (), and ident_current

I encountered a problem today, and finally found that it was caused by insufficient understanding of @ identity, scope_identity () and ident_current. Write it down and give a prompt to new users like me. There are two tables Table1 and Table2 at

Whether the stored procedures in SQL Server contain transactions and whether the returned results are processed successfully

-- Replace the original unitcodingCommunityReplace data with the new unitcodingCreate procedure DBO. sp_changeunitcoding(@ Oldunitcoding varchar (20 ),@ Newunitcoding varchar (20))AsDeclare @ returnvalue varchar (1)Begin Tran T1 -- 1Update tab_a

Ask: create command statements dynamically in SQL Server

Table Name:Peishain(Warehouse receiving ticket) Table Structure: innumber char (8), indate datetime, intype char (12 ),Cangwei char (12 ),Pihao char (18), inweight decimal (9, 2), remark varchar (80) The dynamic statements built in SQL Server are

SQL Server Performance Analysis-view the table data page

Returns the table name, index name, and number of rows. Select object_name (I. object_id) as objectname, I. [name] As indexname, sum (P. Rows) as rowcnt From SYS. Indexes I Inner join SYS. partitions P On I. object_id = P. object_id And I. index_id =

Query execution information of SQL Server Stored Procedures

View Code create view view_job_info Select B. [name] [job name], case when B. Enabled = 1 then' enable 'else' disable 'end [Enable] , A. step_name [step name], A. Command From MSDB. DBO. sysjobsteps a inner join MSDB. DBO. sysjobs B on A. job_id = B.

Standard SQL Server transaction usage xact_abort

A very valuable article: Http://www.sqlstudy.com/ SQL _article.php? Id = 2008060701 One of the keys is set xact_abort on. [I personally think This is the simplest and most effective method] If try catch is applied, use the following system

Common SQL server connection errors and troubleshooting methods

The most common errors in SQL Server connection:1. "SQL server does not exist or access is denied"This is the most complex. There are many causes of errors and there are many aspects to check.Generally, there are several possibilities:1. incorrect

Optimization of SQL Server Stored Procedures (Simple Analysis of variable tables and temporary tables ))

Yesterday, a friend sent a piece of SQL stored procedure (as shown below). Let me see if it can be optimized. Insert @ T1 Select g_no, co_no, si_no, str_no, sum (ind_qty) as Qty From instock_detail where in_id = @ ID group by g_no, co_no, si_no, str_

SQL Server data import and export Methods

Data import and export will be used when SQL Server programming or management is involved. There are many ways to import and export data, which can be summarized based on my experiences in Project Creation:   1. SQL Server Import and Export wizard.

SQL Server Performance Tuning series (7)-raid

I. Introduction to raid RAID (Redundant Array of independent disk independent redundant disk array) is a data protection policy.   Ii. Several Common RAID levels   1. RAID 0: Data I/O can be improved through parallel reading. reading efficiency is

Patches and suggestions for SQL Server security issues

  Iii. SQL Server unpatched vulnerabilities John's SQL Server is installed on Win 2000, with no patching and no patching, no matter how strict your permission settings are, they are all broken. The following example is an attack on the vulnerable

Wonderful null in SQL Server

Http://www.cnblogs.com/changbluesky/archive/2010/05/07/1729519.html PS. Too lazy to write, too lazy to summarize, copy a good summary, but there are some not said, in short, several errors encountered when the null should be considered more test   I

Obtain the names of all sheet worksheets in the Excel file in SQL Server.

Create a function:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->If exists (select * From DBO. sysobjects where id = object_id (n' [DBO]. [f_sheetname] ') and xtype in (n'fn', n'if', n'tf

SQL Server Identity vs uniqueidentifier

The most common method to automatically generate a primary key is: 1. the identity attribute treats the original seed value as its first parameter and the increment value as its second parameter value. 2. specify your field as the unique identifier

SQL Server publishing and subscription

1. Publishing and subscriptionUse forced subscription to synchronize DatabasesLarge amounts of data and batch data can be processed using the database synchronization mechanism://Note:Publishing Server (distribution) operation, subscription server

Exists structure in SQL Server

Exists Structure The exists structure is a tsql function, which returns a Boolean variable for the subquery in parentheses. If the subquery returns any row, the structure returns true; otherwise, it returns false. This structure is especially

SQL Server database backup and restoration statements

-- Create a backup deviceUse [Master]GoExec master. DBO. sp_addumpdevice @ devtype = n 'disk', @ logicalname = n 'beifen', @ physicalname = n'd: \ beifen. Bak'Go-- Complete backup to the backup deviceBackup database [Student] to [beifen] With

Common global variables of SQL Server

@ Servername: return the name of the local server running SQL Server 2000.@ Remserver: return the name of the Remote SQL Server server recorded in the logon record.@ Connections: returns the number of connections or attempts to connect to the SQL

SQL Server monitoring series-1

As a DBA, it not only helps developers Write Excellent query scripts, but also efficient data storage architecture. In fact, most of the time is in operation and maintenance, and most of the work time is not saturated, but why are some DBAs so busy,

SQL Server queries the number of tables in a database

Select * From sysobjects where (xtype = 'U ') Xtype = 'U' indicates the xtype char (2) object type. It can be one of the following object types:C = check ConstraintsD = default value orDefault ConstraintF = foreign key constraintL = LogFn = scalar

Total Pages: 923 1 .... 872 873 874 875 876 .... 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.