1, what is statistical informationThe following is an official description of the statistics:By default, if a column in the table does not have an index, SQL Server automatically creates statistics for that column. The query optimizer then evaluates
--Determine if the name of the view you want to create existsif exists (SELECT * from dbo.sysobjects WHERE id = object_id (N ' [dbo].[ View name] ') and OBJECTPROPERTY (ID, N ' isview ') = 1)--Delete ViewDrop view [dbo]. [View
1. Install MySQL ODBC driver on SQL Server side2. Add MySQL to an ODBC data source (Control Panel \ All Control Panel items \ Administrative Tools)To add a configuration driver to a User DSN and System DSNNote: The character set must correspond to
A variable is a user-defined, assignable, and participating entity in Transact-SQL, which can be divided into global variables and local variables in two categories. Where global variables are customized and maintained by the system, global variable
SQL Server does not have a group_concat function in MySQL that can connect grouped data together.After the search on the internet, found a way to implement this function, hereby recorded.Selecta,stuff ((SELECT ', ' + b from #tb WHERE a = t.a FOR XML
Sometimes we need to share data with third parties, but we don't have a completely open database. Therefore, the use of database role authorization can be a good solution to this problem. The following are the SQL statements used in the work. Just
Connection queries are the most important queries in relational data, including inner joins, outer joins, and so on. You can implement multiple table queries by using the Join operator. The INNER JOIN query operation lists the data rows that match
A nested query refers to a query that is nested inside another query statement. A nested query is also a subquery, in which a subquery is evaluated first in the SELECT clause, and the subquery results as a filter for the outer layer of another query,
-------------------------------------------------------the first query to see how many tables in the library, table names, and so on select * from INFORMATION_SCHEMA. TABLES;-------------------------------------------------------the second query
The entity (entities) Contact (relationships) model abbreviation E-R model is also called the E-r method, which was first proposed by P.p.chen in 1976. There is also a key element of the Attributes-property, which provides a user-oriented expression
C # code backs up the database and does not require additional DLLsprotected void Button1_Click (object sender, EventArgs e){///Backup method///SqlConnection conn = new SqlConnection ("server=.; DATABASE=AAAA; User Id=sa; Password=sa; ");SqlCommand
The following prompt appears when you open SQL Server:SQL2008 user ' sa ' Login failed (Error 18456)Workaround:1. Open the database --Log in to the database with Windows identity2. Security----logon name---SA---open property settings3, General-Set
Network-related or instance-specific errors occur when you establish a connection with SQL Server. Unable to find or access the server, sqlserver
When I started the system this morning, I found that I could not log on to the database when I opened
Required SQL statement (8) integrity constraints of the database and SQL integrity
Entity integrity1. Define the primary key when creating a table
Create table Name(Sno int identity (1, 1 ),Sname nvarchar (20 ),-- Set the primary keyPrimary key (Sno)
Tips for SQL Server addition, deletion, modification, and query
Insert statement
1. Insert only the default value in the data:
Insert into [DBTrain]. [dbo]. [log_info]Default values
2. In a field that can be null, if you want to set null, you can
Required SQL statement (2) create a table, modify the table structure, and delete a table.
1. Create a database table
-- Which database is used? If this statement is left blank, It is the default database, you can also select the current database
Required SQL statement (3) data insertion and SQL statement
1. Small specifications for using insert statements
1) it is best to add N before a Chinese String2) The column name is expanded with brackets like this [column name] 2. Conventional
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