SQL stored procedure BASICS (Process Control)

Here we will talk about the process control of the stored procedure. if else, case, while, there is no for loop here. These are not as good as c, c ++, c # and other languages. First, let's look at the use of if elseCopy codeThe Code is as

Detailed description of the task scheduling mechanism based on SQL Server OS

Introduction On Windows, SQL Server OS is a user-level operating system level used to serve SQL Server. It abstracts some functions of the operating system from the entire SQL Server engine and forms a separate layer to provide services for the

How to process single quotes and double quotation marks in SQL statements

The following describes the Insert statements, but the Select, Update, and Delete statements are the same.Assume that the following table is available:MytabeField 1 username string type (name)Field 2 age numeric type (age)Field 3 birthday

The sorting result of SQL Server is not desired.

In forums, people often ask such questions.:Why is the result set of the same query sometimes arranged in the desired order, sometimes not, or in the order of SQL2000, to SQL2005/2008?In fact, as long as "order by" is not specified in the statement,

SQL operations on excel tables (query, import, and insert)

Copy codeThe Code is as follows:-- Configure permissionsEXEC sp_configure 'show advanced options', 1;GORECONFIGURE;GOEXEC sp_configure 'ad Hoc Distributed Queries ', 1;GORECONFIGURE;GO SQL SERVER and EXCEL Data Import and Export1. query Excel Data

SQL Server sets primary key auto-increment columns (implemented using SQL statements)

1. Create a new data table with the field id. Set the id as the primary key.Copy codeThe Code is as follows:Create table tb (id int, constraint pkid primary key (id ))Create table tb (id int primary key) 2. Create a new data table with the field id.

Misunderstanding of SQL Server clustered index and Primary Key

Many people may mix the Primary Key and clustered index, or think this is the same thing. This concept is very incorrect.A primary key is a constraint attached to an index. This index can be a clustered index or a non-clustered index.Therefore, if a

SQL Server misunderstanding: 30 days talk about multiple images and log transmission latency of one instance on 7th days

Misunderstanding #7: A database may have multiple imagesErrorThis misunderstanding is quite common. Each primary server only supports one backup storage. If you want to have copies of multiple master servers, use transaction log transmission.

Misunderstanding of SQL Server: 26 misunderstandings about restoration (Restore) in 24th days

This series of articles has never touched on the "Restore" topic, because once this topic is involved, it will involve a lot of misunderstandings, it's as long as I can't finish using an article.In fact, I want to number every misunderstanding in

Introduction to WINDOWS performance counters in sqlserver

Processer:% Processor Time Processor is busy with task execution Time threshold 80%, CPU bottlenecks, insufficient memory, low query plan reuse rate, unoptimized statements, and so on.SQLServer: Buffer ManagerBuffer cache hit ratio Adjust the

MongoDB sets access permissions for users

MongoDB has been in use for a long time, And MongoDB-based data storage has never been used for permission access (MongoDB is set to have no permission access restrictions by default). Today I have spent some time studying it, the research results

SQL Server database practical SQL statements

-- View the foreign key constraints of a specified tableSelect * from sysobjects where parent_obj in (Select id from sysobjects where name = 'table name ')And xtype = 'pk'-- View All TablesSelect * from sysobjects where xtype = 'pk'-- Delete

How to use commands related to SQLite Database Management

1. Create a database Start the command line and run the following command to open the Shell mode CLP: Sqlite3 test. db Although we provide the database name, if the database does not exist, SQLite does not actually create the database until it

First day of SQL Study -- Understanding of SQL UNION and UNION ALL operators

SQL UNION operatorThe UNION operator is used to merge the result sets of two or more SELECT statements.Note::1. SELECT statements within UNION must have the same number of columns. Columns must also have similar data types. In addition, the columns

The first day of SQL Learning -- SQL defines variables as tables (Virtual tables)

SQL defines variables as the Table TypeWhen defining variables in SQL statements, we often define variables like char, varchar, nvarchar, int ........, so how to make a variable as a virtual table is actually very simple.Basic Syntax:Copy codeThe

SQL Server compilation and recompilation scenarios and advantages and disadvantages of reuse

Meaning of compilation --------------------------------------------------------------------------------When SQLSERVER receives any command, including query, batch, stored procedure, trigger)Pre-compiled commands (prepared statement) and dynamic SQL

SQL Server: Merge multiple rows into one row and perform grouping statistics.

Copy codeThe Code is as follows:-- Create a test table and insert dataCreate table test (code varchar (50), [values] varchar (10), [count] int)INSERT test SELECT '001', 'AA', 1Union all select '001', 'bb ', 2Union all select '002 ', 'aaa', 4Union

SQL Server misunderstanding: 30 days talking about 1st days of running transactions continue to be executed after Server failover

Misunderstanding #1: After server failover, ongoing transactions continue to be executedOf course this is wrong!Each failover is accompanied by some form of recovery. However, if the transaction being executed does not have a Commit, the connection

SQL Server misunderstanding: on the 30 th day, the number of TempDB files in 12th days should be consistent with the number of CPUs.

Misunderstanding #12: The number of TempDB files must be consistent with the number of CPUs Error Alas, the above misunderstanding is Microsoft's "official" suggestion, and there are still a large number of blog posts sticking to this viewpoint.

SQL server Table Structure Modification Method

What should we do if we need to modify the SQL server table structure? The following describes how to modify the SQL server table structure.Add a varchar column to the SQL server table:Alter table distributors add column address varchar (30 );Delete

Total Pages: 923 1 .... 842 843 844 845 846 .... 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.