Database trivia that. NET programmers need to know

Source: Internet
Author: User
Tags mssqlserver
About the database

As a "sentimental" (b-grid-higher). NET Development Engineer, how much does it take to know some of these little stories.

Even if it's just a matter of some nonsense.

1. File-based database (common)

Access

Sqlite

SqlServerCe

2. There are two types of SQL Server

Specifically, there are two types of SQL Server: MSSQLSERVER, and Sybasesqlserver.

The relationship between the two is like this.

SQL Server, a relational database management system (DBMS) developed and promoted by Microsoft, was originally developed by Microsoft, Sybase, and ashton-tate three companies, but later with the collaboration of the two companies, They have added different extensions to their own versions, respectively.

And then there's the

MSSQLServer,

and Sybasesqlserver.

3. Batch start how do I use batch processing to start SQL Server services?

Start: net start MSSQLServer (service name)

Close: net stop mssqlserver (service name)

Note: Windows 7 or later needs to run CMD as an administrator.

4. Login Failed Login failed solution

1) Log in with Windows Authentication mode to see if authentication is supported!

2) Login with Windows authentication, "security" → "login name" to see if it is disabled!

5. What types are included in primary key primary key primary key?

Business key similar to study number, work number, social security number and so on, the General university course will default to do this thing as the primary key! (Not recommended)

The logical primary key has no practical meaning and is numbered only, not related to the business logic. Recommendations

Combined primary key two fields together as primary key! This is often done in college courses. But (strongly not recommended)

6. Data types commonly used in MSSQLSERVER

1) Picture image

2) string

CHAR (TEN) varchar (nchar) nvarchar (10)

varchar (max) nvarchar (max) text (TEN) ntext (10)

2.1) The difference between char and varchar

Char is a fixed-length

VARCHAR is variable-length from the point of view of the compressed space, the general use of varchar is better.

2.2) The difference between nchar and Char

For example char (10) can store 10 letters, 5 characters

The nchar (10) is encoded using Unicode and can store 10 letters and 10 characters.

2.3) What type of lengthy text is stored?

Server 2000 Used Text/ntext

Now with varchar (max)/nvarchar (max)

  • Related Article

    Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.