• Introduction to the use of with as in SQL Server


    1、 The meaning of with as With as phrase, also known as subquery factoring, allows you to do a lot of things and define a SQL fragment that will be used by the entire SQL statement. Sometimes, it is to make the SQL statement more readable, or it may be in different parts of union […]

  • Why SQL Server2008 order by cannot be used directly in union clause


    According to the requirements, each takes top 20. Since it is random, SQL Server order by newid() is used, and then all the data are unionized. So I immediately gave the answer: selecttop 20 *fromxxxwheretype=1orderbynewid() union selecttop 20 *fromxxxwheretype=0orderbynewid() But the SQL query analyzer is wrong and the syntax is wrong. At first glance, it […]

  • SQL Server 2008 Express and Management Studio Express download installation configuration tutorial


    This article mainly talks about how to download, install, configure SQL Server 2008 Express and SMSs step by step, and finally use SMSs to connect to local database services. Why write this article? In the first database principle class of this semester, the lecturer shared the materials needed for the course, including a 3.1gb SQL […]

  • Usage of declare variable in sqlserver


    Declare usage in SQL I usually write SQL queries and stored procedures by feeling. I haven’t explored the specific syntax of SQL. I always imitate SQL according to C ා. A problem encountered in the project a few days ago has aroused my interest in the scope of declare defined variables. We all know the […]

  • SQL Server form query problems and Solutions


    Q1: the student scores table is as follows. Use an SQL statement to query the names of students whose scores are greater than 80 in each course Q2: table demo_ Delte is as follows: delete all the same student redundant information except for different automatic numbering Q3: the team table is as follows: A, B, […]

  • Analysis of dynamic SQL statement in mybatis


    This article mainly introduces mybatis in the dynamic SQL statement parsing, the article through the example code introduction is very detailed, to everybody’s study or the work has the certain reference study value, needs the friend may refer to There are two ways to configure SQL in mybatis, one is to use XML to configure, […]

  • Analysis of SQL integrity constraint statement in database


    integrity constraint Integrity constraints are for the correctness of table data! If the data is incorrect, it cannot be added to the table in the first place. 1 primary key When a primary key constraint is added to a column, the data in that column cannot be repeated. In this way, the value of the […]

  • How to open sqlserver remote access


    After the installation of Microsoft sqlserver 2012, the following work needs to configure the SQLSERVER database to allow remote access. Only if the remote access of sqlserver is configured, can other IP clients access it. The configuration of SQL server remote access is roughly divided into three steps, namely, the configuration of SQL Server Management […]

  • SQL server query results beyond the query time range solution


    Let’s cut the crap. Go directly to the SQL code (test and verify it if you are interested). Why did the following query statement query the records of 2008-11-27? This is a problem encountered by colleagues. I designed an example. USE AdventureWorks2014; GO SELECT * FROM [Person].[Person] WHERE ModifiedDate >= ‘2008-11-26 00:00:00:000’ AND ModifiedDate <= […]

  • Detailed explanation of JSON function of SQL Server


    SQL Server 2005 began to support XML data types, providing native XML data types, XML indexes and various functions for managing or outputting XML formats. With the popularity of JSON, SQL Server 2016 began to support JSON data types. It can not only directly output the result set in JSON format, but also read the […]

  • Explain how to connect datagrip to MS SQL server


    DataGrid supports almost all mainstream relational database products, such as DB2, Derby, H2, mysql, Oracle, PostgreSQL, SQL server, sqllite and Sybase. It also provides an easy-to-use interface that allows you to execute queries in different modes. In this article, we introduce the method of connecting DataGrid to MS SQL server. JetBrains datagrip tutorial Datagrip can […]

  • Common transact SQL scripts for SQL Server database (recommended)


    Transact-SQL Transact SQL (also known as T-SQL) is the implementation of ANSI SQL on Microsoft SQL server and Sybase SQL server. It is similar to the PL / SQL of Oracle (it not only implements ANSI SQL, but also supports the characteristics of its own database system). It is still used as the core query […]