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.
Original: SQL SERVER memory allocation and common memory issues (2)--DMV queryMemory dynamic management view (DMV):Starting from Sys.dm_os_memory_clerks.SELECT [Type], sum (virtual_memory_reserved_kb) as [VM reserved], sum (virtual_memory_committed_kb) as [ VM Committed], sum (awe_allocated_kb) as [awe allocated], sum (shared_memory_r
Blockingsessionid, db_name (Blocked database_id) as DatabaseName, Sess. Login_name as Blockinguser, Sess. Host_name as Blockinglocation, Blockingsql. Text as Blockingsql, Blocked. session_id as Blockedsessionid, blockedsess. Login_name as Blockeduser, blockedsess. Host_name as Blockedlocation, Blockedsql. Text as Blockedsql, SUBSTRING (blockedsql. Text, (blockedreq. Statement_start_offset/2) + 1,(case when blockedreq. statement_end_offset =-1Then LEN (CONVERT (NVARCHAR (MAX), blockedsql. Text))
Common SQL Server date comparison and date query statements
In SQL Server, you may need to obtain the current date and calculate some other dates. For example, your program may need to determine the first or last day of a month. Most of you probably know how to divide a date
, easy to view, or can be copied into Word. Knowledge Points: 1, how forms trigger events between each other to refresh dataThis tool is two interface, when the main interface main load will determine whether the login, if not login will be loaded login form login. The tree in main will be refreshed after successful login in login. Implementation code: Define the event in login and trigger the event after the login is successful. ///
///Define login for event delegate//
Common SQL Server test questions (1) Question 1 Problem description: create three tables for managing job business training information: S (s #, Sn, SD, SA) s #, Sn, SD, SA stands for student ID, Student name, organization, student age C (C #, CN) C #, CN stands for course number, course name SC (s #, CN respectively #, C #, g) s #, C #, and g respectively repres
to remove the space on both sides!) nvarchar (n): A variable-length Unicode character data that contains n characters. The value of n must be between 1 and 4,000. You can store up to 4,000 characters, both English and Chinese, in 2 characters. varchar: If the possible value of a field is not fixed length, we only know it cannot exceed 10 characters, it is the most advantageous to define it as varchar (10). Stores variable-length data, so it does not fill with spaces, but storage efficiency i
This article transferred from: http://blogs.msdn.com/b/apgcdsd/archive/2012/01/18/sql-server-2012-1-18.aspxSeveral common factors affecting application performance of SQL Server databasePerformance issues are one of the common pro
The following information is collected from the http://hi.baidu.com/delphistu,http://hi.baidu.com/zhvsbyThe description may be incorrect. Please verify yourself
SQL Server common function set
I. character conversion functions1. ASCII ()Returns the ASCII value of the leftmost character of a character expression. In the ASCII () function, strings with numbers are
SQL Server common functions
I want to record some common SQL functions before, but it has never been implemented... Hey hey...
Until today, the substring () function is used. in C #, the start value of this method is 0, while in SQL
TimeS: can go directly or select cast (' 2004-09-08 ' as datetime) valueO:select to_date (' 2004-01-05 22:09:38 ', ' yyyy-mm-dd hh24-mi-ss ') Vaule from DUAL;43. Find the difference between a part of two dates (e.g. seconds)S:select DateDiff (Ss,getdate (), GETDATE () +12.3) valueO: Subtract directly from two dates (e.g. d1-d2=12.3)SELECT (D1-D2) *24*60*60 vaule from DUAL;44. Date of novelty based on difference (e.g. minutes)S:select DateAdd (Mi,8,getdate ()) valueO:select sysdate+8/60/24 vaule
, containing the number of rows in the table, not including the number of data entries in the index
From Sys.dm_db_partition_stats P
INNER JOIN sys.objects o
On p.object_id = o.object_id
where p.object_id= object_id (' Table name ')
GROUP BY O.name
--by page or district statistics, have performance impact, accurate
--Displays space information for the data and indexes of all tables or views in the current database
--Include: logical fragmentation, zone fragmentation (fragmentatio
, but to understand that there is no substitute for whereSelect age,count (*) as from the person group by age have age>15---Group statistics according to age, and select groups older than 15--Removing duplicate dataSelect from person--federated result set (combining query results into 1 query results) Note: The top and bottom two query statement fields must be consistent (name, type, number must be the same)Select from personunion Select from StudentNote: The difference between Union and unio
There are two types of SQL Server authentication, one is Windows authentication, and the other is SQL Server authenticationWindows Authentication Connection string:string connectionString = "data source=localhost;database= database name; Integrated security=true ; User Instance=false; ";Integrated securi
') --Return 10 Datepart (): returns the integer of the part of the specified date for the specified date. The Datepart () method works similarly to Datename (), except that the Datename () method returns a string, and the Datepart () method returns an integer value. The method has two parameters: Parameter 1: Specifies a string that returns the specified part of the specified date. Can be a date part or an abbreviation in. Parameter 2: Specifies the date string to manipulate. Select DATEPA
(50), -- password@ Email nvarchar (200) -- email address)AsDeclare @ userID int -- User ID-- The Logon account has been registeredIf exists (select loginID from tableName where loginID = @ loginID)BeginReturn-1;End-- The email address has been registered.Else if exists (select email from tableName where email = @ email)BeginReturn-2;End-- Registration successfulElseBeginSelect @ userID = isnull (max (userID), 100000) + 1 from tableNameInsert into tableName(UserID, loginID, [password], userName,
_ table_name ', 'new _ table_name'-Modify the data table nameEXEC sp_rename 'table _ name. [old_column_name] ', 'new _ column_name', 'column '-Modify the field name4. Get the Stored Procedure content by specifying the stored procedure nameCopy codeThe Code is as follows:Exec sp_helptext sp_nameThe following is about Database Control* The following are security-controlled system stored procedures or SQL statements. For more information about the synta
database entity that you want to fix
DECLARE @dbname varchar (255)
Set @dbname = ' Name of the database entity that needs to be repaired '
exec sp_dboption @dbname, ' Single user ', ' true '
DBCC CHECKTABLE (' name of the data table to be repaired ', repair_allow_data_loss)
DBCC CHECKTABLE (' name of the data table to be repaired ', repair_rebuild)
------Change the name of the ' data table to be repaired ' to the name of the data table that executes the DBCC CHECKDB times error
exec sp_d
A stored procedure in Transact-SQL, very similar to a method in the Java language, can be called repeatedly. After the stored procedure executes once, the statement can be cached so that the statements in the cache are used directly at the next execution. This can improve the performance of your stored procedures.? The concept of stored proceduresStored procedure procedure is a set of SQL statements that ar
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.