To make the database more capable of resisting attacks, you must take several steps. Some measures are only part of good server management, such as having the latest patches for SQL Server, and others include in-use user supervision. The following
1. String Functions
Length and Analysis
Datalength (char_expr) returns the number of characters in the string, but does not contain spaces
Substring (expression, start, length ).
Right (char_expr, int_expr) returns int_expr characters to the
SQL Server sorting rules are usually not used many times, and many beginners may be unfamiliar, but some
A common error occurs when you query a database that is connected to multiple tables in different databases.
If the default Character Set of the
For example:Select * from table1 where name = ''zhangsan'' and tID> 10000And execution:Select * from table1 where tID> 10000 and name = ''zhangsan''Some people do not know whether the execution efficiency of the preceding two statements is the same,
Copy codeThe Code is as follows:Create view dbo. vw_db_dictionaryASSelect top 100 PERCENT dbo. sysobjects. name AS table_name,Dbo. sysproperties. [value] AS table_desc, dbo. syscolumns. name AS field,Properties. [value] AS field_desc, dbo. policypes.
Error 21002: [SQL-dmo] the user *** has an error.This error occurs when MSSQL backup is transplanted to another server for restoration.The main reason is that the original user information is retained during Backup recovery, resulting in isolated
Today, we use the time Like '2017-06-2008 'statement to query all the data of the day. A statement error is prompted. After checking, we found that the fuzzy query can only be used for fields of the String type.I also consulted some materials. There
You can set the AccessCount field to accumulate access from the same IP address in a specific time range as required.Copy codeThe Code is as follows:Create table Counter(CounterID int identity (1, 1) not null,IP varchar (20 ),AccessDateTime datetime,
I installed SQL server before and deleted it later. Now, "a previously installed program has created a suspended file on the installation computer. You must restart the computer before running the installer. Unable to proceed.Steps:1) Add/delete
Copy codeThe Code is as follows:-- Create database dbTempUse dbTempCreate table test(Pid int identity (1, 1) not null primary key,Years datetime,IsFirstSixMonths int default (0), -- 0 indicates first half 1 indicates second half --TotalCome
At that moment, my heartbeat reached my blind eye.Run the Account creation command. OK!Remote Login, enter the account, password, OK! Finally, I went in again!*I suddenly found that the database server could not be logged on.The system prompts that
Syntax SET IDENTITY_INSERT [database. [owner.] {table} {ON | OFF}Parameters Database is the name of the database where the specified table resides.OwnerIs the name of the table owner.TableIs the name of the table containing the ID column.For example,
If you carefully track the login process of the SQL Server database Server, you will find that password computing is actually very fragile. The weak password of the SQL Server database reflects two aspects:1. Password Encryption Algorithm for
In the current work, we need to solve the problem of copying the entire SqlServer database. The copied content includes the database outline, stored procedures in the database, functions, table structure, primary-foreign key relationships, and all
Copy codeThe Code is as follows:Select *FROM table1Where (id in (, 2 ))Copy codeThe Code is as follows:Select *FROM table1Where (id in (, 2) if all the conditions after In are numbers, the MSSQL sorting should beCopy codeThe Code is as
When querying a database, we sometimes need to find data records in rows within a specified range in the data table. For example, we need to find the 10 data records between 10th rows and 20th rows in the data table, so how can we implement it?The
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.