A view is actually a storage query, with the emphasis on mixing and matching data from a base table (or other view) to create objects that work in many ways, like another base table. You can create a simple query that selects only a few columns from
Introduction to Knowledge points
Two-way search: Here is not a concept, directly say its role
ISNULL () function: Determine if the function has a value, if the variable is not assigned to the given value, the following example is if the
--Simulate the environment first, followed by: Use [Temp]go--drop table [testtab]truncate table [Testtab]create table [dbo]. [Testtab] ([Useracount][varchar] (+) not Null,[username][varchar] (NO) null,[crdatetime][datetime] not null,[value][numeric ]
Today, a guy said to create a database, made a half-day did not fix, accustomed to the graphical interface, these things have forgotten all back to the teacher ...1 Use [Master]2 GO3 IF EXISTS(SELECT 1 fromsysdatabasesWHERENAME=N'hktemp')4 BEGIN5
Recursive subordinate departments to obtain relevant departmental units
Department Table:
SQL statements:With Temp1 as (select Groupid,g_parentid from Sys_group where groupid={current department groupid}union Allselect Sys_
Today, when attaching a database in MSSQL, I am prompted for operating system error 5 (Access denied), here I did not give two solutions for everyone to solve the problem.Scenario One: Switch login mode This occurs because of the "Mixed
1. DefinitionThe set operation compares the result set of two input queries by row by line, determining whether a row should be included in the result of the collection operation, based on the comparison result and the set operation used. Because
simulates three libraries (in the same instance), namely DB1, DB2, DB3The business of the whole transaction is as follows: 1, DB1 write table Data 2, DB2 write table Data 3, DB3 Call stored procedure write table Data 4, each write table data
SQL Server deletes the data and removes the page's information from the database. TableBorder=1px style="width:500px;height:200px;text-Align:center;margin:0Auto> TR Style="Background:red"> Td>NumberTd> Td>TitleTd>
Introduction:
The first few days of learning the project found a bit of basic insight into SQL.
About the primary key in SQL, foreign key.
Primary key:
There are 2 primary keys for the primary key. One is a business primary key
1: Add a field to the tableAlter table [table name] add [column name] Type2: Delete FieldAlter table [table name] Drop column [column name]3: Modify the field type in the table (you can modify the type of the column, whether it is empty)ALTER TABLE [
1--sqlserver Logging mechanism 2--logging transaction time, but there is no guarantee to record the name of the user initiating the transaction, and not to record the initiator's program name!!! 3 Use AdventureWorks 4 CREATE TABLE A (a INT) 5 go 6
Schneider's built-in SQL Server database uses the default Windows login mode so that we cannot remotely connect over IP, and this is where the modification method is recorded.1. Modifying the TCP/IP protocol used by SQL Server servicesA) Bring up
SQL ServerClear cache:
DBCC dropcleanbuffers
Removes all purge buffers from the buffer pool.
DBCC Freeproccache
Removes all elements from the procedure cache.
DBCC Freesystemcache
Frees all unused cache entries from all
How to view LocksUnderstanding the locking of SQL Server at a certain point in time is undoubtedly an effective means of learning to lock and diagnose database deadlock and performance. The most common way to view database locks is in two ways:Use
1. String function length and analysis1,datalength (char_expr) Returns a string that contains the number of characters, but does not contain subsequent spaces2,substring (expression,start,length) takes a substring, the subscript of the string is
1. Windows authentication: Native connection or trusted LAN connection (usually used in case of forgetting administrator password or doing system configuration).2. SQL Server Authentication: Use user name, password authentication
functions commonly used to intercept strings in SQL Server:1. Left(character_expression, integer_expression) function Description: Left('Source String','to intercept the leftmost number of characters') returns the specified number of characters from
Introduction to SQL function substr, SQL function substr
Interpretation of the substr (string, 1, 3) function: returns a string with a length of three characters from left to right.
Result: str
From right to left?
There should be another function to
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.