SQL code
Data operations between databases on different servers -- Create linked server Exec Sp_addmediaserver ' Itsv ' , ' ' , ' Sqloledb ' , ' Remote Server name or IP address ' Exec Sp_add1_srvlogin ' Itsv '
Data operations between databases on different servers
-- Create a linked serverExec sp_addrole server 'itsv', '', 'sqloledb', 'remote server name or IP address'Exec sp_add1_srvlogin 'itsv', 'false', null, 'username', 'Password'
-- Query
Data operations between databases on different servers -- Create linked server Exec Sp_addmediaserver ' Itsv ' , ' ' , ' Sqloledb ' , ' Remote Server name or IP address ' Exec Sp_add1_srvlogin ' Itsv ' , ' False '
I. Basics1. Description: create a databaseCreate database database-name2. Description: Delete a database.Drop database dbname3. Description: back up SQL server--- Create a device for the backup dataUSE masterEXEC sp_addumpdevice 'disk', 'testback', '
Backup restore: A server as the primary server, the client update is updated on a server, B server is secondary server, b timing and a consistent, the result of B a copy/backup, but there is a difference in time. Implementation method: a scheduled
Data Development-Classic
1. Sort by last name stroke:
Select * from TableName Order by CustomerName Collate chinese_prc_stroke_ci_as//from less to more
2. Database encryption:
Select Encrypt (' original password ') Select
https://bbs.csdn.net/topics/230059074Https://www.cnblogs.com/vinsonLu/p/4456027.htmlData operations between different server databasesThe library name of the database is the Dvnewsprovider=sqloledb database is connected by SQL--Create a linked
There are two main ways to use MySQL for Python operations:
Native Module Pymsql
ORM Framework Sqlachemy
PymsqlPymsql is a module that operates MySQL in Python and is used almost the same way as MySQLdb.Download installationPIP3
Data operations between different server databasesWays to replicate table data between different databases:When the table target table is present:INSERT INTO destination database: Table SELECT * FROM source database: TableWhen the target table does
Set MySQL passwordSET PASSWORD = PASSWORD (' [email protected] ');Setting up a MySQL remote connectionGRANT all privileges on * * to ' root ' @ ' 192.168.4.0 ' identified by ' [email protected] ' with GRANT OPTION;Forgot MySQL PasswordUPDATE
First, SQL syntax1. Query Statement SelectSELECT * FROM table name where query condition2. Delete statementsDelete table name where delete condition3. INSERT statement InsertsInsert into table name (Field 1, Field 2) VALUES (' Value 1 ', ' Value 2 ')
Data operations between different server databases--Create a linked serverexec sp_addlinkedserver ' itsv ', ' ', ' SQLOLEDB ', ' Remote server name or IP address 'exec sp_addlinkedsrvlogin ' itsv ', ' false ', NULL, ' username ', ' password '--query
Lele.xu-sql Server cross-Library queryWay One:StatementSELECT * from database a.dbo. Table A, database b.dbo. Table b b WHERE A.field=b.field"DBO" can be omitted asSELECT * from Database A. Table A, database B.. Table b b WHERE A.field=b.fieldMode
SQL Server statement Operations--1, getting the table's primary key fieldSelect name from syscolumns where id=object_id (' table name ') and colid= (select top 1 colid from Sysindexkeys where id=object_id (' table Name '))Select A.column_name From
Backing up a database using mysqldump
1. Backing up a database
mysqldump--user [user name] --password=[password] [database name] > [dump file]
Or
Mysqldump-u[user name]-p[password] [database name] > [dump file]
Example:
1. enable ad hoc distributed queries
Enable the ad hoc distributed queries service before using OpenRowSet/OpenDataSource. Because this service is insecure, sqlserver is disabled by default.
How to enable ad hoc distributed queries
SQL Server
1. sort by strokes of the Last Name:Select * From TableName Order By CustomerName Collate Chinese_PRC_Stroke_ci_as // From less to more
2. database encryption:Select encrypt ('original password ')Select pwdencrypt ('original password ')Select
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.