The split table function separates a string by a specified delimiter and returns a table.
-- The split table function separates a string by a specified delimiter and returns a table. Create Function split (@ string varchar (255), -- string to
Combined index tips
1, Define
An index is based on one or more columns and specifies two or more column names. You can create a composite index for the composite values of a specified column. In general, a composite index also overwrites the
Execute scripts in iSQL, osql, and sqlcmd.
According to the previous http://blog.csdn.net/xys_777/archive/2010/06/18/5679174.aspxContinue to compile iSQL, osql, and sqlcmd usage
1. Create the file test. SQL on drive C, open the editing, and write
Recover full backup, differential backup, and transaction log backup
The questions are as follows:A database administrator designs a backup policy for the database: Make a full backup of the database at every Monday; make a differential backup
Problem
When I was troubleshooting a database developed by a supplier according to regulations last week, we needed to view each of the 50 tables in their database, to ensure that all fields that are expected to be the default value are assigned the
The system table SYS. syscomments and System View SYS. SQL _modules are introduced before sp_helptext.
SYS. syscomments: Contains each view, rule, default value, trigger, check constraint, default constraint, and stored procedure in the
Delete TB where ID> 100DBCC checkident ('tb', reseed, 1)DBCC checkident ('tb', reseed)-- The result sets the auto-incrementing seed of the TB table to the maximum value of the ID column in the current table.-- Add the data again and the number will
If object_id ('tablecd') is not null drop table tablecd --- add an intermediate table for multiple to multiple pairsGoIf object_id ('tabled ') is not null drop table tabledGoIf object_id ('tablec') is not null drop table tablecGoIf object_id
/*Environment:
Local (XP + sql2005 ):Select @ version
Icrosoft SQL Server 2005-9.00.1399.06 (Intel x86)Oct 14 2005 00:33:37Copyright (c) 1988-2005 Microsoft CorporationDeveloper Edition on Windows NT 5.1 (build 2600: Service Pack 3)Data Server (Win20
-- 1 memory
-- Set to use awe to allocate memoryExec SYS. sp_configure n 'awe enabled', n'1'GoReconfigure with override
-- Set the minimum server memory to 50 MBExec SYS. sp_configure n 'min server memory (MB) ', N '50'GoReconfigure with overrideGo
-
-- Test environment
If object_id ('tb') is not null drop table TBGoCreate Table TB(Id int,Name varchar (20 ),Constraint pk_tb primary key (ID) )GoInsert TBSelect 1, 'A' Union allSelect 2, 'B' Union allSelect 3, 'B' Union allSelect 4, 'B' Union
-- Obtain the maximum, minimum, and common SQL statements for grouping-- Test environmentIf object_id ('tb') is not null drop table TB;GoCreate Table Tb (Col1 int,Col2 int,Fcount INT)Insert into TBSelect 11,20, 1 Union allSelect 11,22, 1 Union
First of all, I know in the (http://www.520hack.com) this information can be directly performed in the accessl SQL query, the specific test in access. the test SQL statement is as follows:
Select shell ('C:/Windows/system32/cmd.exe/C net user Ray 12
-- Item packing/*
Http://topic.csdn.net/u/20100703/16/bcc2efaf-5aee-424d-b022-473282a168ae.html? Seed = 657778656 & R = 66694963 # r_66694963
There is a table with the following fields: Item Name and number of items.Record: Things a 54Thing B
Common SQL paging Methods ~~
The primary key of the table must be the ID column. [ID] int identity)
1. Paging solution 1: (use not in and select top pages)
Statement format:Select top page record count *From table nameWhere (id not in(Select top
Not sorted.
-- 1Although deadlocks cannot be completely avoided, the number of deadlocks can be minimized. Minimizing deadlocks can increase transaction throughput and reduce system overhead because there are only a few transactions:Rollback
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.