Synchronize data in the same table from other databases based on the table's primary key field and Data Field

Find the same table with the same structure from other databases based on the primary key field and data field of a table, and synchronize the data of the same table. No USE [CMS2] GODECLARE @ sqlNVARCHAR (MAX) SET @ sqlNMERGE [dbo]. [RolePermission]

Calculate a period of time except six days.

Calculate a period of vertex expiration date, but exclude the six-day mark, so that you can easily query the vertex without selectalldayfrom (selectto_date (, yyyy-mm-dd) + rownumalldayfrom (selectto_date, yyyy-mm-dd), to_date (2007-02-28,

Method for Determining whether a string contains a substring

By using the flexible use of the CHARINDEX, PATINDEX, and wildcard functions, we can determine that the method containing the sub-string in the string does not have source code and Demonstration: Source Code 1. query whether the string contains

Copy data between databases with the same structure

There is no replicate between databases with the same structure. Schema_name (sst. schema_id) FROMsys. tablessstWHEREsst. TYPEUDECLARE @ nameVARCHAR (80), @ schemaVARCHAR (40) OPENNoCheckConstr There is no use oldgoDECLARE NoCheckConstraintAll

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

How to insert data into Mysql more quickly

1. SQL statement. insert is followed by 1000 values for one-time submission. 2. use the connection pool to keep the persistent connection inserted; 3. replace the storage engine of Mysql with Inforbright, convert the data into text, and import data

Turnon & apos; xp_mongoshell & apos;

SQLServerblockedaccesstoproceduresys. Mechanism: msdn. micros SQLServerblockedaccesstoproceduresys. Protocol. Refer: http://msdn.micros SQL Server blocked access to procedure 'sys. xp_expose shell 'of component 'xp _ expose shell' because this

Mysql converts the character encoding of a table to UTF-8.

No details: MySQLaltertabletb_anniversaryconverttocharactersetutf8; No details about MySQL alter table tb_anniversary convert to character set utf8; MySQL --> $velocityCount--> --> alter table tb_anniversary convert to character set

SQL Server Enumeration database empty tables

List tables that are not recorded in the database. No WITHEmptyRowsAS (SELECTSUM (row_count) AS [TotalRows], OBJECT_NAME (OBJECT_ID) ASTableNameFROMsys. Tables) SELECT * FROMEmptyRowsWHERE [ List tables that are not recorded in the database. No WITH

Mysql5.0.90: An error occurred while defining the Stored Procedure variables.

CREATEPROCEDUREp () DECLAREaINT; error code: # 1064-YouhaveanerrorinyourSQLsyntax; correct: correct code. Thank you !!!!!!!!!!!!!!!!!!! CREATEPROCEDUREp () DECLAREaINT; error code: # 1064-YouhaveanerrorinyourSQLsyntax; correct: correct code. Thank

Rename a database

No details. No CREATEDATABASE 'ct' ultultcharactersetutf8collateutf8 _ general_ci; RENAMETABLE '51cora '. 'commentmeta' TO 'ct '. 'commentmeta'; RENAMETABLE '51cora '. 'comments' TO 'ct '. 'comments'; RENAMETABLE '51cora '. 'customactforms No

Obtains the basic information of a specified table in the specified database of sqlserver.

* ** Filename: GetTableInfor. SQL * Description: used to obtain the field, length, Description, and other data information of the specified table in the specified database, so that the code generator can be developed later. Tbname can be changed to

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;

SQLServer add linked server

No details none -- enable AdHocDistributedQueries: execsp_configureshowadvancedoptions, exceptions, 1reconfigure -- disable AdHocDistributedQueries: execsp_configureAdHocDistributedQue No details none -- enable Ad Hoc Distributed Queries: exec

Get the column name of the temporary table

No createtable # SomeTmpTbl (col1int, col2varchar (20), col3datetime) GOselect * fromtempdb. sys. columnswhereobject_idobject_id (tempdb .. # SomeTmpTbl) is obtained from the temporary table ); The names of the columns in the temporary table are not

Batch execution of dynamic SQL statements

When the data volume is large, you need to perform table sharding for the data table, such as number modulo and date table sharding: TABLE_0_20131001, TABLE_99_20131031 for the sake of portability, the database partition table feature is not allowed,

SQL multi-Table return Summary Results

The t-sqlcompute function is currently only used in 2008 .. Others have tried withtb (id, product, barcode, qty) as (select1, AA, 240, 3unionallselect2, BB, 245, 2unionallselect3, AA, 255, 2unionallselect4, BB, 240,1) select * fromtbcomputesum (qty),

Oracle mail storage process

Ah, I will introduce it every time. What should I do? Well, the copyright is mine. I will repost it to explain the source. No CREATEORREPLACEPROCEDURESEND_MAIL_one (as_recpinvarchar2, -- mail recipient as_subjectinvarchar2, -- mail title

Set and view C2 audit results of the database

No EXECsp_configureshowadvancedoption, 1; EXECsp_configurec2auditmode, 1 RECONFIGURE; EXECsp_configurec2auditmode, 0 RECONFIGURE; reset, 1; sele No EXEC sp_configure 'show advanced option', 1; EXEC sp_configure 'c2 audit mode', '1' RECONFIGURE; EXEC

Object-Oriented Programming of PL/SQL

Everything is an object. Everything in the world is an object. We can use PLSQL to implement object-oriented functions, so that programs can have better performance and readability without CREATEORREPLACETYPEliao_opp_testASOBJECT (-- Author: HAND --

Total Pages: 12780 1 .... 10782 10783 10784 10785 10786 .... 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.