Alibabacloud.com offers a wide variety of articles about sql server common criteria compliance, easily find your sql server common criteria compliance information here online.
The following articles mainly compare SQL Server and common Oracle functions. This article mainly introduces the specific content of common functions related to mathematical functions and trigonometric functions. The following describes the specific solution, I hope this will help you in your future studies.
Mathematic
the length of the substring to be returned. Select Left (' abc123 ', 3) --returns to the "left portion
of the right side of the section ', 4 Right (): used to return the portion of the specified length in the given string. The method has two parameters: Parameter 1: Used to specify the string to manipulate. Parameter 2: Used to specify the length of the substring to be returned. Select Right (' abc123 ', 3) --Return to 123
Select Right (' left side portion ', ' 4 ')- -Ret
, which avoids longer locking of the system tables.25. Avoid using cursors as much as possible, because cursors are inefficient and should be considered for overwriting if the cursor is manipulating more than 10,000 rows of data.26. Before using a cursor-based method or temporal table method, you should first look for a set-based solution to solve the problem, and the set-based approach is generally more efficient.27. As with temporary tables, cursors are not unusable. Using Fast_forward cursors
value of a column sum (column) returns the sum of a column example: Selectavg (age) as
aveagefromsalemanager *//*sql index There are two kinds, clustered index and nonclustered index, the clustered index storage record is physically continuous, and the nonclustered index is logically continuous, the physical storage is not contiguous.
Clustered index A table can have only one, and a table of non-clustered indexes may exist multiple. */--CREATE VIEW
upgrade, which is different from. NET Framework and does not consider backward compatibility.The Code is as follows:
Using system; using system. collections. generic; using system. LINQ; using system. text; using Microsoft. sqlserver. management. SMO. registeredservers; // in Microsoft. sqlserver. SMO. using Microsoft. sqlserver. management. SMO; // you need to add Microsoft. sqlserver. SMO. DLL reference using Microsoft. sqlserver. management. common
table [Table name] Drop constraint name
Create Default ValueAlter table [Table name] add constraint default name: Default \ '51windows. Net \ 'for [field name]
Delete default valueAlter table [Table name] Drop constraint default name
Delete logs in SQL Server to reduce the size of database filesDump transaction database name with no_logBackup log database name with no_logDBCC shrinkdatabase (database name)
Tags: expr server character bin int intercept string str res code 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 the left of the stringSelect Left('sql_server_20
/* The reliability and performance monitor is a standard tool used by sql08 to monitor servers. It has updated the report counter for SQL Server.You can use these counters to track many different server resources and activities.SQL Server Profiler is an analysis and optimization tool that can be used to track server e
server| Problem | performance
1. To optimize the query, you should try to avoid full table scan, first consider the where and the order by the columns involved in the establishment of the index.
2. The null value of the field in the WHERE clause should be avoided as far as possible, or it will cause the engine to discard the use of the index for a full table scan, such as:Select ID from t where num is nullYou can set the default value of 0 on NUM to e
Tags: server ACK data user store SQL function trigger procedure default value1. sp_help Report about database objects (all objects listed in Sys.sysobjects compatibility view)sp_help table name, stored procedure name, etc.2. sp_helpdb report effective information about the databasesp_helpdb database name3. sp_helptext Default value, unencrypted Transact-SQL store
Question 1: Use the. net2005 sql-express not connected.
Workaround:
1. Network firewall block database connection;
2. Default sql-express does not start sa account-> download a Management Studio Express Interface tool Management sql-express
3. Wireless network will appear according to the machine name can not find the SQL
As we know, the SQL Server transaction log is used primarily to record changes made to the database by all transactions, and if the system fails, it becomes the only source of the latest data. Log operations often have the following applications:
One, the transaction log file LDF lost
When we do not delete or LDF file loss, the database only left MDF files, at this time directly through the additional MDF
Common Data Types in SQL Server:
BinaryA fixed-length binary data with a maximum length of 8,000 bytes.
VarbinaryA variable-length binary data with a maximum length of 8,000 bytes.
ImageA variable-length binary data with a maximum length of 2G +-1 (2,147,483,647) bytes
TextServerCodeThe maximum length of non-Unicode data in the Variable Length page is 2G +
Common Data Types in SQL server:BinaryA fixed-length binary data with a maximum length of 8,000 bytes.VarbinaryA variable-length binary data with a maximum length of 8,000 bytes.ImageA variable-length binary data with a maximum length of 2G +-1 (2,147,483,647) bytesTextThe variable length of non-Unicode data in the server code page cannot exceed 2G + (2,147,483,6
Tags: SQL Server update SELECT * Into A--automatically generate table A, and table A's structure data is the same as table BFrom BINSERT into A--a to be created in advanceSELECT * FROM B Insert into A (field 1, Field 2,...) Values (value 1, value 2,...) INSERT INTO A Values (value 1, value 2,...) Insert into A (field 1, Field 2,...) Select field A, field B,... from B Correct update: Update Ut_syhh_ C
date intervalsDECLARE @begin_dateDate= '2014-12-31',@end_dateDate= '2016-12-31'; withGeneratehelpdata as( Select 1 asID,CAST( Case when Right(@begin_date,5)='12-30' Then DATEADD( Day,1,@begin_date) ELSE @begin_date END asDATE) asEndingDateUNION All SELECTId+1 asID, Case when Right(DATEADD(QQ,1, EndingDate),5)='12-30' Then DATEADD( Day,1,DATEADD(QQ,1, EndingDate)) ELSE DATEADD(QQ,1, EndingDate)END a
If you need to manage sqlserver, you can add them to your favorites for future use.
If you need to manage SQL server, you can add it to your favorites for future use.
1. view the database version
Select @ version
2. view the operating system parameters of the machine where the database is located
Exec master .. xp_msver
3. view database startup parameters
Sp_configure
4. view the database startup time
Sele
Now the main use of the building station or ASP and PHP, the two languages commonly used in the database for SQL Server and MySQL, the two databases have their own strengths, but also say who good who bad, look at personal habits.
The purpose of the SQL Server Import and Export Wizard is to copy data from the source t
1. view the database version
Select @ version
2. view the operating system parameters of the machine where the database is located
Exec master .. xp_msver
3. view database startup parameters
Sp_configure
4. view the database startup time
Select convert (varchar (30), login_time, 120) from Master .. sysprocesses where spid = 1
View database server name and Instance name
Print 'server name ...... + convert (v
constraint nameDEFAULT(The default Dongdong) forexample of a column name:ALTER TABLEStudbADD CONSTRAINTDf_ssexDEFAULT('male') forSsex
5. Check the constraints------you, you're the one that's stopping me from checking. (check)
Effect: Stop check, pass before you can enter the table
Usage:1when you build a table, add it directly behind the type.CREATE TABLEStudb (SIDCHAR( A), SnameVARCHAR( A), StunoVARCHAR( A), SsexCHAR(2), SageINT CHECK(age>= - andAge -)
)
2after the table
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.