local table update B Set B. column A =. column A from OpenRowSet ('sqlodb', 'SQL Server name'; 'username'; 'Password', database name. DBO. table Name) as a inner join local table B on. column1 = B. column1 -- create a connection for openquery usage -- first create a connection to create the connection server exec sp_a
;--current session process ID
SELECT @ @textSize;
SELECT @ @version;--Current database version information
9. System Statistic function
SELECT @ @CONNECTIONS;--Number of connections
SELECT @ @PACK_RECEIVED;
SELECT @ @CPU_BUSY;
SELECT @ @PACK_SENT;
SELECT @ @TIMETICKS;
SELECT @ @IDLE;
SELECT @ @TOTAL_ERRORS;
SELECT @ @IO_BUSY;
SELECT @ @TOTAL_READ;--Read disk count
SELECT @ @PACKET_ERRORS;--Number of network packet errors that occurred
SELECT @ @TOTAL_WRITE;--sqlserver the number of disk writes p
find books, we generally use the way (the definition of parameters and data collection on the Assignment simulation page): 1 DECLARE @publishers VARCHAR (a);
2 SET @publishers = ' Tsinghua University Press ' ;
3 SELECT * from WHERE Publishers=@publishers The results are as follows: When the publisher filter condition is NULL, how do you write SQL? 1 DECLARE @publishers VARCHAR (a);
2 SELECT * from WHERE Publishers=ISNULL(@publishers, Publishers
the physical memory installed on the computer. Configure the SQL Server max server memory Server configuration option to 1.5 times the physical memory (half the virtual memory size ).7. Increase the number of server CPUs. However, you must understand that resources such as
First, describe the memory used by SQL Server. The memory occupied by SQL Server is mainly composed of three parts: Data Buffer, Procedure Cache, and SQL Server engine program. The cache occupied by
Source: http://www.cnblogs.com/doosmile/archive/2012/03/16/2400646.html--Connect remote SQL or insert data with OPENROWSET--if it's just temporary access, you can use OPENROWSET directly--query ExampleSELECT * FROM OPENROWSET (' SQLOLEDB ', ' SQL Server name '; ' User name '; ' Password, database name. dbo. Table name)
the Name of the current Language.
Select @ lock_timeout; -- returns the current lock timeout setting for the current session (MS)
Select @ max_connections; -- returns the maximum number of user connections allowed by the SQL Server instance at the same time.
Select @ MAX_PRECISION AS 'max Precision '; -- returns the Precision level used by the decimal and numeric data types.
Select @ SERVERNAME; -- Name of
If you want to query Index Server through SQL Server, you must use the OPENQUERY function. The syntax structure is as follows.
OPENQUERY (pai_server, 'query ')
The linked_server parameter indicates the connection name. The query p
Label:When we read and write database files, these process activities trigger some run-time events when a file is read, written, or an error occurs. From a user's point of view, some of the time will be concerned about these events, especially our debugging, audit, service maintenance. For example, when database errors occur, column data is updated, CPU usage is high, and so on, tracking these states is ver
by the executor (query Executor) through OLE as an interface to the access method (Access Methods). access Method (Access Methods) The access method is to provide a storage structure for your data and indexes, as well as a batch of code to modify the interface through data retrieval or data. It contains all the code that retrieves the data itself without performing an action, which passes the request to the buffer manager. Suppose our SELECT statemen
Label:Write in front: This is the first T-SQL query Advanced series article. But the T-SQL query step-up series is far from finished. This topic is advanced and I think it is because this topic requires some advanced knowledge as the basis. If there is any mistake in the article, please do not hesitate to correct me. T
Enable AD Hoc distributed Queries: ' Show advanced Options ', 1
Reconfigure
' Ad Hoc distributed Queries ', 1
Reconfigure
When you are finished using, close ad Hoc distributed Queries:' Ad Hoc distributed Queries ', 0
Reconfigure
' Show advanced Options ', 0
Reconfigure
Operation:
' SQLOLEDB ' ' SQL Server name ' ' User name ' ' Password '
' SQLOLEDB ' ' S
memory size to at least three times the physical memory installed on the computer. Configure the SQL Server Max Server Memory server configuration option to 1.5 times the physical memory (half the virtual memory size ).7. Increase the number of server CPUs. However, you mus
Tags: index solution based on keyword har results in SQL Server failure efficiencyProblem: There's a lot of data on both tables. The A1 field in a table needs to be associated with the B table primary key query A1 field stores multiple B table primary keys The format is: Format 1:B1,B2,B3 Format 2:B4 Format 3:b5,b6 Comma-delimited minority This leads to the use o
groupedSuch as:-The total number of girls and boys receivedSelect Sex,count (*) from Student GROUP by sexOrder of Query statements:Select from where the group by has an order byNote: Where is the filter for the source data. It can only use columns that are referred to in the table following the fromAn aggregate function cannot be used after a where condition, and an error will be made if usedHavingIf you are filtering the result set after grouping, t
Before: This is the first T-SQL query advanced seriesArticleBut the advanced series of T-SQL query is far from finished. I think this topic needs some advanced knowledge as the foundation. If there are errors in this article, please do not correct it. The content of this article requires the indexing knowledge as the b
Label: CREATE VIEW View_1--Create a new view name as--functions for building viewsSelectStudent.sno,sname,cno,degree fromStudent join score on student.sno=Score.sno GoSelect* fromView_1wheresno='1'
Select* from
(SelectStudent.sno,sname,cno,degree fromStudent join score on STUDENT.SNO=SCORE.SNO) asTable2 wheresno='101'--define as a temporary table with AS and then query the results from the table.
is also a sub-qu
query speed, the faster(Of course, don't look for an example with only a few hundred records to counter me.).
Let's go further: OK. Now let's take a look at it again. Let's change the SQL statement to see how MSSQL executes this SQL statement?Now remove the index: drop index t_userinfo.index_useridNow open [show statement execution details]: Set showplan_all on
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.