SQL Server performance analysis query table space and available space
Posted @ zping read (58) | comment (0) Edit Interval between querying long transactions and SQL Execution
Posted @ zping read (110) | comment (0) Edit Query execution
A. rename a table
Rename the table oldtablename to newtablename:
Exec sp_rename 'oldtablename', 'newtablename'
B. rename a columnRename the column oldname in table 1 to newname.Exec sp_rename 'table1. oldname', 'newname', 'column'
Note: Table 1
SQL Server connection string Encryption
Use components provided by ASP. NET
-Wordpress Encryption
-PDF decryption
{0} Name of the node to be encrypted
{1} project path
C: \ windows \ Micrsoft. Net \ framework \ versionnumber \
The default datetime format of the Chinese version of SQL Server is yyyy-mm-dd thh: mm: Ss. Mmm.
For example:
Select getdate ()
11:06:08. 177
This is inconvenient for people who want to transfer data between different databases or the regular date
SQL Server for XML Path some may not know others. In fact, it shows the query result set in XML format, with this feature, we can simplify our query statements to implement some work that may previously need to be completed through the function live
Document directory
SQL Server:
For MySQL/SQL Server/Oracle/MS access:
For MySQL/SQL Server/Oracle/MS access:
MySQL:
SQL Server/Oracle/MS access:
SQL primary key constraints
The primary key constraint uniquely identifies each record in the
Example of a trigger codes:
Code of the insert, delete, and update trigger:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->-- DBO. trgroups. SQL
If exists (
Select * From sysobjects where
Name = '
An error occurred while establishing a connection with the server.. When you connect to SQL Server 2005, the default setting does not allow remote connection to SQL Server may cause this failure. (Provider: SQL network interface, error: 26-An error
During project optimization, I want to analyze SQL server system performance through the database layer. I checked the online code and modified the title and dmvs code, the following code analyzes the SQL statements that are busy after the system
1. @ connectionsReturns the number of connections or attempts since Microsoft SQL Server was last started.Example: The following example shows the number of logon attempts by the current date and time.Select getdate () as 'date and time', @
Identity is often used in SQL Server.
Identifier
Column, this self-increasing field operation is indeed more convenient. But it sometimes brings some trouble.
Example 1: when some data is deleted from a table, the number of the
The SQL Server Management studio manager is really cheap. It was accidentally discovered today by using the script tracker.I modified the rowflag field int to bit for a field type.
The SMS manager did this.
For example, table name: ABC1. Create a
First:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Declare @ iErrorCount int
Set @ iErrorCount = 0
Begin tran Tran1
Insert into t1 (Id, c1) values (1, '1 ')
Set @ iErrorCount = @ iErrorCount +
I. Function Classification
Functions are classified into scalar functions and table-valued functions. The former returns a scalar value, and the latter returns the result in the form of a table.
Ii. scalar functions
A scalar function accepts 0 or
Introduction
Encryption refers to the process of fuzzy processing of data by using a key or password. In SQL Server, encryption cannot replace other security settings, such as preventing unauthorized users from accessing the database, the Windows
The ado document creates a new Parameter object using the specified property.
Syntax
Set parameter = command. CreateParameter (Name, Type, Direction, Size, Value)
Return Value
Returns the Parameter object.
Parameters
Name (optional) is a string
Announcement: QQ group: 124766907, if you are in. the NET field has unique insights and profound programming skills. It has expertise in a certain field. You are welcome to join this group. This group already has several MVPs, In the SL ,. NET, BS
ProblemThere are running instances when dates and times don't show up at your doorstep in the format you 'd like it to be, nor does the output of a query fit the needs of the people viewing it. one option is to format the data in the application
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.