object that contains a string @str
SELECT DISTINCT object_name (ID) from syscomments where text like '% @str% '
Create an encrypted stored procedure or function with the with encryption parameter in front of AS
Decryption of encrypted stored procedures and functions can be done using the Sp_decrypt procedure
10. View information about users and processes in the database
sp_who
View information about active users and processes in the
Label:In SQL Server, each query will find the shortest path to achieve its own goal. If the database accepts only one connection at a time, only one query is executed. Then the query is, of course, M.F.B. s to complete the work. For most databases, however, multiple queries need to be processed at the same time. Instead of waiting for execution like a gentleman,
meet the form of SARG, it cannot limit the search range, that is, SQL SERVER must determine whether each row meets all the conditions in the WHERE clause. Therefore, an index is useless for expressions that do not meet the SARG format.After introducing SARG, let's summarize the experiences of using SARG and drawing different conclusions from some materials in practice:
1. Whether the
it satisfies all the conditions in the WHERE clause. So an index is useless for an expression that does not satisfy the Sarg form.After the introduction of Sarg, we will summarize the experience of using SARG and the conclusions of certain materials encountered in practice:1. Whether a like statement belongs to Sarg depends on the type of wildcard you are usingsuch as: Name
; tool-> option-> Connection-> Enter a larger number in the box after the login timeout (seconds)
You can usually connect and, if prompted incorrectly, go to the next step.
Five errors are typically caused by SQL Server using Windows only authentication, so users cannot connect using SQL Server's login account, such as SA. The workaround looks
SQL Server Hosting Toolkit This toolkit allows you to operate SQL Express,sql Server 2000, SQL Server 2005 databases locally, and then easily migrate your data definitions and data. Ins
of 2, which is the same as the CHARINDEX function. The% mark here tells the PATINDEX function to find the string "BC", regardless of the number of characters in the string being searched before and after "BC"!If you want to know whether the searched string starts with a specific string, you can omit the previous% mark. The patinded function should be written like this:Patindex (AB%,ABCD)The result of this command execution returns 1, indicating that
process the credit card transaction and store the results instead of the credit card information itself. You cannot encounter security breaches without data!Two phases of securityThe SQL Server security model, like Windows, is a two-stage process that allows users or other logins to access protected resources on the server:Authentication: The user logs on, authe
performance.Any statement optimizer that uses is null or is not NULL in the WHERE clause is not allowed to use the index.Recommended scenario: Replace with other operations with the same function, such as a is not null change to a>0 or a> ', etc. Also set the field is not allowed to be empty, but with a default value instead of a null value, such as a datetime field, you can set the default time to "1900-01-01".7. > and The greater than or less than the operator generally does not need to adjus
How can SQL Server obtain processor (CPU), Memory (Memory), Disk (Disk), and operating system information through SQL statements? sqlserversql
In SQL server, how does one obtain SERVER hardware and system information through
SELECT statements must have the same number of columns2. The data type of the corresponding column in all SELECT statements must be compatibleThe procedure for executing a query statement that contains a union is as follows:1. Execute all SELECT statements in sequence2. Combine the result set of all SELECT statements into one result set3, sorting the result set, and filtering out duplicate records (due to the need for 3rd step operation, resulting in a low efficiency of the joint query)Can use
The following issues were encountered:On-line Server A, brokered server B, local server CThe data is above a and wants to operate on a B like select * FROM [a]. [database].table Such SQL, do not have to link the server, directly i
Examples of using wildcards in SQL Server: server wildcards
In some cases, familiarity with the use of SQL Server wildcard can help us solve many problems.
-- Use the _ operator to search for USEAdventureWorks2012, a three-letter
.
Illustration 2.4: The Login name-New dialog box enables Windows logon to access the SQL Server instance.
Tips:Never keep the default database as the master database. This is a painful lesson: Connecting to the server is too easy to forget to modify the database. Then if you run the script to create hundreds of database objects on the master database, you wi
transaction is non-disruptive, and a transaction cannot see the data in the middle of a time when other transactions are running
Persistence (durability): persistence means that, during the execution of a transaction, the changes made to the data must be saved by a physical storage device before the transaction is completed successfully, which guarantees that the modifications will not be lost if any system is paralyzed.
Theoretically, all transactions should be completely isolated from o
the SQL batch uses the parallel hint maxdop>1 to execute the SQL statement, this results in creating subtasks (sub-tasks),Each sub-task (sub-tasks) is executed by the loop above: The task is created and then suspended .The other (worker worker) has to deal with this subtask (sub-tasks)You will see the current list of worker workers in SQL
notTRUNCATE TABLE cannot be used for tables that have a FOREIGN key constraint reference.Change-UPDATE statement:Update table name set column name = update value [WHERE condition]WHERE clause does not update all dataFor example, add two points to Zhang San's score in the score table:Update score Table Set score = Score +2 where name = ' Zhang San 'Check select-query statement:1. Select Column name from table name where condition2. SELECT statement Parameters:into: Save query results to a new ta
18. Create and use a view tableView tableView table conceptsCreate a viewModify and delete a tableEnhanced viewing table functionality in SQL Server 2000SummaryIn Chapter 17th, we learned about indexes. indexes are a secondary database structure independent of the database data structure, but they are related to accessing database data. In other words, an index is an independent structure, but is integrated
and, if prompted incorrectly, go to the next step.
Five errors are typically caused by SQL Server using Windows only authentication, so users cannot connect using SQL Server's login account, such as SA. The workaround looks like this:
1 Use Enterprise Manager on the server
addition, you will need to screen out 1433 ports in TCP/IP filtering to hide your SQL Server database as much as possible. Like this one but let the attack create SQL Server account, also can not immediately use Query Analyzer remote login for next attack. If you are constr
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.