Copy codeThe Code is as follows:Create table [dbo]. [TbGuidTable] ([TableName] [varchar] (50) not null,[KeyName] [varchar] (20) not null,[KeyValue] [varchar] (100) NOT NULL) ON [PRIMARY]GOIf exists (select * from dbo. sysobjects where id = object_id
AccessThe operation is very simple. The specific steps are as follows: Open your mdb database, tools> Database Utilities> compress and restore the database (c )...SQL SERVER In general, the contraction of the SQL database does not greatly reduce the
Copy codeThe Code is as follows:-- Sales champion-- Problem: in the company, the boss came in and asked for a report of the sales and sales staff of the top 3 sales in each region.---Create table salesdetail(Area int not null,Saler nvarchar (20) not
When using a database, it is inevitable that you delete it during use. If you use an int-type field to make it grow, this is the easiest way, but some of the consequences are not what you want! Take a look at this Demo: 1. create a simple table
Numeric FunctionsABS (): returns the absolute value.CEILING (): round to the maximum integer.FLOOR (): round to the smallest integer.ROUND (): ROUND (A, B) A is the number to be processed, and B is the number of digits accurate to the decimal
IntroductionIn the previous article (Introduction to SQL query (part I), I have explained the basic concepts of database query and Single Table query in detail. In this article, it mainly describes the various connections in SQL and the scope of use,
However, fields with the identity feature do not need to be unique, not the primary key.Set identity_insert tablename (on | off) can be used to control whether a value can be specified in the identity field during runtime, rather than automatically
I saw a post on the Forum ,《How can I query records of consecutive dates?, As follows:
Insus. NET tries to write a program and tests it to get the expected results. The SQL code can be used for reference and learning.Copy codeThe Code is as follows:-
To implement the /"target =" _ blank "> SQLServer replication function today, many sqlserver s are deleted before, which may lead to expansion of insecure factors, as a result, many functions are unavailable and there is no way to restore the
As follows:Copy codeThe Code is as follows:Create function [dbo]. [udf_DaysInMonth](@ Date DATETIME)RETURNS INTASBEGINDECLARE @ dim as table (m int, Dy INT)Insert into @ dim VALUES),),(2,Case when (YEAR (@ Date) % 4 = 0 and year (@ Date) % 100 <> 0)
I don't know whether stored procedures can be implemented, but SQL Server 2000 Job Scheduling does have this function. How can I make some SQL statements run regularly and perform the following operations in sequence:Enterprise Manager-- Manage--
SET instead of SELECT is recommended for SQL Server.When the expression returns a value and assigns a value to a variable, the SET method is recommended.The following table lists the differences between SET and SELECT. Pay special attention to the
1. Expand the Server Object --> link server --> right-click "new link server"Note: You must log on as a database administrator (usually the sa account) before creating a "linked server"
2. Enter the IP address of the linked server
3. Set the
1. scalar function: the result is a single value that can contain a logical processing process. Uncertain System functions such as getdate () cannot be used.Copy codeThe Code is as follows:-- Scalar Value Function-- ==================================
A typical example of A deadlock between two processes is: Obtain lock A in process T1 and apply for lock B; obtain lock B in process T2 and apply for lock A. Here we will demonstrate this situation:
1. Create a Database named InvDB.
2. Execute the
However, the SQL Performance with IN is always relatively low. The SQL Execution steps are used to analyze the differences between SQL with IN and SQL without IN:SQL tries to convert it to the join of multiple tables. If the conversion fails, it
A. Use DECLARE The following example uses a local variable named @ find to retrieve information of all authors whose names start with a Ring.Copy codeThe Code is as follows:Use pubsDeclare @ find varchar (30)Set @ find = 'ring %'Select au_lname,
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.