When we use a table in a database, we often encounter two ways to use the table, namely, the use of temporary tables and table variables. In practical use, how can we flexibly use them in stored procedures, although they implement the function is
In this essay, our main focus is on Key-range Lock. Key-range Lock has s-s, S-u, I-n, x-x several cases. One by one, we strive to understand. Unfortunately, this may be lengthy, so deadlock analysis has to be postponed in turn.Get rule for Range s-s
Three basic steps for. NET access to a database:A. Connect to the database:To use the SqlConnection class in the SqlClient namespace;Define a SqlConnection object: Dim Sqlcon as New SqlConnectionThe settings to be made are:1.sqlCon. connectionstring=
In the database operation request recently given to me by my boss, there is a table with a shopping list style, with the customer ID, product ID, number of items, unit price and total price of the item, and the date of sale. There is also a product
Everything is for performance, everything is for businessFirst, the logical execution order of the query(1) from left_table (3) Join_type join Right_table (2) in Join_condition (4) WHERE where_condition (5) GROUP by group_by_list (6) with {cube |
All global variables in SQL Server are prefixed with two @ symbols--[email protected] @error The error number of the last T-SQL error (the error number for which the constraint was to be violated)Insert intoSubjectValues('Test Engineer')--violation
First, use Select to retrieve dataData query is the central content of SQL language, the function of the SELECT statement is to allow the database server to retrieve the required information according to customer requirements, and in accordance with
Do you still generate SQL statements in your handwriting program? Are you still silent about the SQL statements that were sloppy? Are you still tangled in the idea of how to express complex SQL statements? Suppose your answer is "yes". Then you're
Case has two formats. Simple case function and case search function.--Simple case function Sexwhen ' 1 ' then ' Male ' when ' 2 ' then ' women ' else ' other ' end--case search function case when sex = ' 1 ' Then ' man ' when sex = ' 2 ' Then '
When the database file is too large, the data is partitioned, that is, the database is split into multiple filegroups. has been convenient data file management, improve the reading efficiency of the database, how to backup and restore the database
In SQL Server, both the cast and CONVERT functions are available for type conversions, and their functions are the same.It's just a different syntax.Cast is generally easier to use, and the advantage of convert is that dates and values can be
1 SELECT2Table name= Case whenA.colorder=1 ThenD.nameElse "' End,3Table description= Case whenA.colorder=1 Then IsNull(F.value,"')Else "' End,4Field ordinal=A.colorder,5Field name=A.name,6Identity= Case when ColumnProperty(
Several methods of SQL Server Traversal tableRead Catalogue
Using cursors
Working with Table variables
Working with temporary tables
In the database development process, we often encounter the situation to traverse the data
Cause Analysis and Solution for SQL Server failure to contract log files, SQL Cause Analysis
An error is reported when the server executes a job that compresses the log file size recently.
One of my batch log shrinking scripts
USE [master] GO/******
SQL database optimization Summary: Millions of database Optimization Solutions,
There are many tutorials on SQL Optimization on the Internet, but they are messy. I have made some preparations recently, and I will share some of them with you. There
Restrictions and extensions of print and sp_helptext in SQL, printsp_helptext
It is common to use dynamic SQL in SQL. Some complex calculations, or stored procedures, have a long code and may execute SQL statements multiple times. However, debugging
In-depth analysis of SQL Server triggers and SQL
A trigger is a special type of stored procedure, which is different from the stored procedure we introduced earlier. A trigger is triggered by an event and automatically called for execution. The
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.