-- Function: Provides replacement Aggregate functions for strings.-- Note: for example, convert the following data-- Test_id test_value--------------------'A' 01, 03,04''A' 02, 04''B' 03, 04, 08''B' 06, 08,09''C' '09''C' '10'-- Convert to the
The following are the custom functions of Infor syteline 8.02:Copy codeThe Code is as follows:MidnightOfAlter function [dbo]. [MidnightOf] (@ Date DATETIME) RETURNS DATETIMEASBEGINRETURN (dateadd (year, (datepart (year, @ Date)-2000), dateadd (month,
Grandma's, why are we only three days in May? The weather in May is the most suitable for traveling, but we cannot afford these tough IT guys.As soon as I arrived at the company, the project manager found the development leader, saying that our
Copy codeThe Code is as follows:-- SQL Server 2000SELECT a. name AS field name, CASE WHEN EXISTS(SELECT 1FROM sysobjectsWHERE xtype = 'pk' AND parent_obj = a. id AND name IN(SELECT nameFROM sysindexesWHERE indid IN(SELECT indidFROM sysindexkeysWHERE
Char (n) is a fixed-length format. The field in the format of char (n) occupies a fixed width of n characters. If the actual length of the stored data exceeds n, the excess data is truncated, if the length is less than n, it will be filled with null
Create add, delete, and update triggers respectively to synchronize data between two tables.1: Data Synchronization increases:If there are two tables, table A and Table B, create A trigger to enable table B to insert data synchronously after Table A
ISNULL
Replace NULL with the specified replacement value.
SyntaxISNULL (check_expression, replacement_value)
ParametersCheck_expression
Whether the expression is NULL is checked. Check_expression can be of any type.
Replacement_value
The expression
Copy codeThe Code is as follows:Create procedure test_tranAsSet xact_abort on ----- judge by @ error. For serious errors, the system will not execute the subsequent judgment on @ error, and the execution will be terminated directly. Therefore, it is
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
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,
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
SQL statements are case-insensitive by default, so the statement:SQL codeSELECT * FROM RecEngineBizInfo WHERE RecEngineBizName = 'qq'AndSQL codeSELECT * FROM RecEngineBizInfo WHERE RecEngineBizName = 'qq'The results are the same.The script to check
1 annotatorAnnotation is a text string that is not executed in the program code. It is a description of the program, which can improve the readability of the program and make the program code easier to maintain, it is usually embedded in a program
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
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
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
Take the first 20 to 30 queries as an example. The primary key name is id.Method 1: perform a regular check first and then perform a reverse check. Select top 10 * from (select top 30 * from tablename order by id asc) A order by id descMethod 2: Use
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