Obtain cluster index information in the SQLServer Database

No SELECTt is used to obtain cluster index information in the SQLServer database. name [Table name], ix. name [Cluster Index name], c. name [clustering index includes fields] fromsys. indexesixINNERJOINsys. tablestONix.

Sqlserver split data '/'

We need to split a data column when doing the requirement and check the code on the Internet. Unfortunately, it is not easy to use. Simply write a demo by yourself. SELECTsubstring (columnname, 0, CHARINDEX (, a) asfirststr, substring (columnname,

Modify Table field definitions

No details. No ALTERTABLEtb_nameMODIFYcolumn_nameVARCHAR2 (200 ); No details. No alter table tb_name MODIFY column_name VARCHAR2 (200 ); --> $velocityCount--> --> ALTER TABLE tb_name MODIFY column_name VARCHAR2(200);

Comparison of MYSQL strings and numbers in Popular Science

If no details are found, MySQLSELECTabc0 returns 1 when writing WHERE. Do not compare the varchar field with 0. No details MySQL SELECT 'abc' = 0 returns 1 when writing WHERE. Do not compare the varchar field with 0. MySQL -->

SQL multi-condition sorting statement

Multi-condition sorting without select * fromi_musicwheresorderbyscorenumasc, datelineasc Multi-condition sorting without select * from I _music where sid = '$ sid' order by scorenum asc, dateline asc Multi-condition sorting --> $velocityCount-

C? O? N? V? E? R? T? Letter? Number? _? ? Period? Ge? Type

C? O? N? V? E? R? T? Letter? Number? _? ? Period? Ge? No CONVERT (data_type, expression_r_r [, style]) Statement and query result: SELECTCONVERT (varchar (100), GETDATE (), 0): 0516200610: 57 AMSELECTCONVERT (varchar (100), GETDATE (), 1): 051606

SQL multi-Keyword Search

SQL multi-Keyword Search without if (count ($ newstr) 1) {if the number of elements in the array is 1, query $ sqlselect * fromtb_infowheretitlelike % according to a single condition. $ newstr [0]. % orcontentlike %. $ newstr [0]. % orderbyiddesc;}

Common T-SQL string functions

T-SQL commonly used string functions none? SELECTSUBSTRING (123456,2, 3); -- 234 SELECTLEFT (123456,3); -- 123 SELECTRIGHT (123456,3); -- 456 SELECTLEN (Hello); -- 2 SELECTDATALENGTH (Hello ); -- 4 SELECTCHARINDEX (); -- 2 SELECTPATINDEX (% [0 T-SQL

Oracle table structure and Data Replication

No details OracleSQLDeveloper -- only copy the table structure createtablestudentTempasselect * Tables; -- the condition is false and no data is obtained -- copy existing table data to the new table insertintostudentTempselect * fromstudent;

Oracle10G view all table names and number of table records under the current user

Today, I have a requirement to count all the table names and records of the current user. I have found a lot on the Internet, but I am not sharing it with you today... Methods that can be implemented. Oracle1. Run createorreplacefunctioncount_rows

View table Field Information

No selectc. colid, c. name, c. xtype, c. length, xprecfromsyscolumnscinnerjoinsysobjectsoono. INVMAorderbycolid is displayed. No select c. colid, c. name, c. xtype, c. length, xprecfrom syscolumns cinner join sysobjects o on o. id = c. idwhere o.

Mysql string functions

Mysql string function usage MySQL marks the first position as 1 for operations on string positions. 1. ASCII (str) returns the ASCII code value of the leftmost character of the str string. If str is a Null String, 0 is returned. If 'str' is NULL,

Delete plan Cache

Delete plan cache SQLServer -- delete the plan cache DBCC of the entire database? FREEPROCCACHE -- delete a database's plan cache USE? MasterDECLARE? @ Dbid? INTSELECT? @ Db table name DBCC? FLUSHPROCINDB? (@ Dbid) Delete plan cache SQL Server --

An update exists during data import, and an insertion does not exist.

When data is imported, there are updates. If no data is inserted, there is no CREATE? Trigger? Tr_bank3? ON? Bank3AFTER? INSERTAS ?????? Update? Bank1? Set? Bank1.fmoneybank1. fmoney + c. ??????? From ????????? (Select? Fid, sum (case? When? TYPE0?

Table variable instead of temporary table

No declare @ ttable (idintidentity, colvarchar (4) declare @ sqlvarchar (60) for variables similar to temporary tables) set @ SQL Lu Bu Zhao Yun Ma Chao Dian Wei Guan Yu Zhang Fei XU Yu Huang Zhongyan Yan Liang Wen ugly pound sun ce declare @ iint;

Determines whether a date is the end of a month.

Determine whether a date is the end of the month without DECLARE @ DtDATETIMESET @ Dt2011-06-30IFMONTH (@ Dt )! MONTH (DATEADD (DAY, 1, @ Dt) PRINTEndOfMonth Determine whether a date is the end of a MONTH without DECLARE @ Dt datetime set @ Dt = '201

Query the stored procedure and function of the required string

No CREATEPROCEDURE [dbo] is available for the stored procedure and function where the required string is located. [StringSearchInSQLObject] @ TextToSearchVARCHAR (2000) ASSELECTDISTINCTOBJECT_NAME (SC. id) ASOBJECTNAME, USER_NAME (so. uid)

Group by user ID, retain the latest 1000 data records of the user, more than 1000 data records

Database field: id, user_id, date ,... other fields: MySQLBEGIN # Routinebodygoeshere... * If you query more than 1000 entries, delete the statement * DECLAREact_friends_user_idINT; DECLAREact_friends_min_idINT; DECLAREdnINTdefault0; * define the

Query indexes that have never been used

No selectobject_name (object_id), * sys. Equals (object_id) isnotnull No select object_name (object_id), * sys. dm_db_index_usage_state where user_seeks = 0 and user_scans = 0 and user_lookups = 0 and system_seeks = 0 and system_scans = 0 and system_

Lists all fields in a specified table.

In the evening, the younger brother yangyu said that he had a table with more than 90 fields, and all the fields should be listed. If you copy them one by one, it would be too much trouble, I wrote a small script. no * lists all fields in the

Total Pages: 12780 1 .... 12427 12428 12429 12430 12431 .... 12780 Go to: GO

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.