In your current job, you need to address the issue of replicating the entire SQL Server database, which includes the database outline, stored procedures in the database, functions, table structure, primary foreign key relationships, and all the data
Introduction to meta-data
The most common definition of metadata (metadata) is "structural data about data," or, more simply, "information about data," which can be viewed as metadata in everyday life, such as illustrations, library catalogs, and
In today's article I want to talk about the more advanced, lightweight synchronization objects that SQL Server uses: Latches (Latch). The latch is a lightweight synchronization object used by the SQL Server storage engine to protect multithreaded
What is SQL injection?
Many web site programs in the writing, the user does not have to judge the legality of input data, so that the application has security problems. Users can submit a database query code (usually in the browser address bar,
In SQL Server database operations, sometimes the result set in a table satisfies certain rules we consider to be duplicate data, and these duplicate data need to be deleted. How do I delete it? This article is illustrated by an example.
Examples
In today's article, I want to show you how to communicate your work and thinking processes to the query optimizer when you want to create an index design for a particular query. Now let's discuss it together!
Queries that have problems Let's look
Similar to the following:
Select A.key,b.key,c.key from A,b,c where trim (a.key) =trim (B.FK) and trim (A.col) =trim (c.pk).
In Table A (more than 200 records), the associated schedule B (more than 40,000 records) was used for 1 seconds, which
Use MASTER
Go
IF EXISTS (SELECT * from Dbo.sysdatabases WHERE
Name= ' My_test_database ')
DROP DATABASE [My_test_database]
Go
CREATE DATABASE [My_test_database]
Go
Use [My_test_database]
Go
CREATE TABLE [my_table] ([my_id] VARCHAR (16))
Go
--The
Before 2008 if we want to pass a table as an input parameter to a SQL Server stored procedure makes it more difficult, it may take a lot of logical processing to pass these table data as strings or XML.
Table-valued parameters are provided in 2008.
A stored procedure in Transact-SQL, very similar to a method in the Java language, that can be called repeatedly. Once the stored procedure is executed once, the statement can be cached so that the statement in the cache is used directly the next
Execute SQL statement with no temporary table in the middle
Prompt server: Message 9002, Level 17, State 2, row 1
database ' tempdb ' logs are full. Please back up the transaction log of the database to free up some log space.
On the
There are the following inquiries:
Copy Code code as follows:
Select IsNull (lastchanged, ') as lastchanged from vhhostlist where s_comment= ' test202 '
Originally, the ISNULL function has only one argument, which means to
In general, it is best to have SQL Server operate in isolation transactions in the default form; Isolation is, after all, one of the basic principles of the acid model. However, sometimes the database administrator has to violate the default
The paragraph restore remains checked to ensure that the database will be consistent at the end. After the restore sequence is completed, if the recovered file is valid and is consistent with the database, the recovered file becomes online directly.
Steps:
One, new text document Xxx.txt, modify file type is. udl
Open the document and find the corresponding service in the provision of data.
Select the required database in the connection and fill in the relevant information.
Test the
This includes installation prompts for pending operations, shrinking the database, compressing the database, transferring the database to new users for existing user rights, checking backup sets, repairing databases, and so on
(i) Suspend
In SQL ServerEach database has a table that is produced by a systemSysobjects this table records all the table names in the databaseWe can use the following SQL syntax for the query action
Copy Code code as follows:
Select name,id from
All of these technologies can be used as a means of maintaining a standby server, and the database can be online as a new primary server when problems arise in your original primary database. However, you have to keep in mind that replacing the
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.