The three main paradigms of SQL Server

The three paradigms of SQL Server database Analysis: The database design should follow three main paradigms, respectively: First paradigm: Ensure the atomicity of each column in the table (non-detachable); Second paradigm: Make sure that each column

Using transactions in SQL Server stored procedures

Stored Procedure format:CREATE PROCEDUREyourprocedure asBEGIN SETNOCOUNT on; BEGINTRY---------------------Start catching exceptionsBEINTRAN------------------Start a transaction UPDATEASETA.names=B.names fromT1 asAINNER JOINT2 asB

Database stored procedure Implementation and deletion change (SQL SERVER 2008)

New data table:CREATE TABLE [dbo].[szsj_message_list]( [ID] [int] IDENTITY(1,1) not NULL, [name] [nvarchar]( +)NULL, [message] [nvarchar]( the) not NULL, [create_by] [nvarchar]( +) not NULL, [create_date] [datetime] not NULL,

How SQL Server obtains information

Get the table for the databaseSELECTobj.name tablename,schem.name Schemname,CAST( Case when(SELECT COUNT(1) fromSys.indexesWHERE object_id=Obj.object_id andIs_primary_key=1)>=1 Then 1 ELSE 0 END as BIT) HasPrimaryKey

Operations for collections in SQL Server (set, difference, intersection) learning

First, let's do the test data.1. Create test data--Create a People tableCreate TablePerson1 (Uidint Identity(1,1)Primary Key, Namevarchar( -) not NULL)--Create a People table 2--Create TablePerson2 (Uidint Identity(1,1)Primary Key, Namevarchar( -)

SQL SERVER Regular Replacement

ole

Use PUBDBGoIF object_id (N ' dbo. Regexreplace ') is not NULLDROP FUNCTION dbo. RegexreplaceGO--Start creating a regular replacement functionCREATE FUNCTION DBO. Regexreplace(@string VARCHAR (MAX),--the string to be replaced@pattern VARCHAR

Setting up a new SQL Server database after installation

Install the database to set the domain administrator as the database owner. Click SQL Server Configuration Manager to enable TCP/IP and named pipes in the SQL Native clinet 10.0 configuration (32-bit) \ Client protocol. The TCP/IP and named

SQL Server Custom Functions

Scalar functionsThe RETURNS clause specifies a scalar data type, the function is a scalar-valued function.Grammar| Schemabinding}] [as]beginsql statement (must have return variable or value) EndInterpretation: The WITH clause indicates the

SQL Server View Backup progress

SELECT db_name (er.[ DATABASE_ID]) [DatabaseName],Er. [Command] As [CommandType],Er. [Percent_complete], Er.start_time,CONVERT (DECIMAL (5, 2), er.[ Percent_complete]) as [complete_percent], CONVERT (DECIMAL (2), er.[ Total_elapsed_time]/60000.00)

SQL Server adds users and authorizes users

--Create userCREATE LOGIN user name with password=n ' password ', default_database= database name, Check_expiration=off, Check_policy=offEXEC sp_grantdbaccess N ' user name '--AuthorizationGRANT SELECT on table name to user name--add "check"

Partial SQL Server Content

SQL classification:DDL data Definition Language CREATE ALTER DROP DECLAREDML Data Manipulation Language SELECT DELETE UPDATE INSERTDCL Data Control Language GRANT REVOKE COMMIT ROLLBACKIndex creation and deletion note: The index is immutable and you

SQL Server 2008 edit all or any line

Select the table right-click on "Edit Top 200 rows" and select the upper-left corner of theSQL icon, then on the right side of the SQL statement to remove the top 200 and then execute the query to edit all the rows, you can choose to write SQL, and

Error 233 occurred while SQL Server was logged on

A 233 error occurred with a colleague using SQL Server. 233 error occurs after you connect 1 databases using Microsoft SQL Server Management Studio and disconnect againViewing Windows log discovery is caused by a limit of maximum connections to ' 3 '

Modified time for query stored procedures in SQL Server

1. Sort all stored procedures by recent changesSELECT [name], [create_date], [modify_date] FROM [sys].[objects]WHERE [type] = ‘P‘ -- 这里也可以替换为:‘U‘,‘IF‘,‘TR‘分别代表用户表,自定义函数,触发器ORDER BY [modify_date] DESC2. Query the creation and modification time of the

How SQL server implements cross-server queries

Dry goods are as follows:exec sp_addlinkedserver ' itsv ', ' ', ' SQLOLEDB ', ' crs.***.com,6598 ' exec sp_addlinkedsrvlogin ' itsv ', ' false ', NULL, ' sa ', ' Password '--exec sp_droplinkedsrvlogin ' ITSV ', null --Delete mappings

Summary of the understanding of functions in SQL Server

T-SQL language provides us with a more flexible way to manipulate data, that is, functions, functions are divided into three main categories: scalar function: (pass in a parameter, and then a parameter) aggregate function (pass in multiple

Understanding stored procedures in SQL Server

The stored procedure of the database is understood as, the subroutine that processes the data, writes like function, uses up like function, in SQL Server the stored procedure divides into two big classes, the system and the custom, the system all

Common functions and operations in SQL Server stored procedures

1. Case statement Used to select statements     SELECTProductNumber, Category= CaseProductLine when 'R' Then 'Road' when 'M' Then 'Mountain' when 'T' Then 'Touring' when 'S' Then 'Other sale Items'

Methods for checking SQL Server table structure description

First, identify all the table names of a libraryuse database_namegoselect tab.name        as  Tablenamefrom   sys.columns col       inner join  sys.tables tab                on col.object_id = tab.object_id       left join

Methods for checking SQL Server table structure description

First, identify all the table names of a libraryuse database_namegoselect tab.name        as  Tablenamefrom   sys.columns col       inner join  sys.tables tab                on col.object_id = tab.object_id       left join

Total Pages: 923 1 .... 656 657 658 659 660 .... 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.