Sort out common functions of mysql and SQL Server for emergency purposes
I haven't used database functions for a long time. I have used them today. By the way, I have sorted out the previous ones. I personally think it is almost the same. I only have three databases: mysql, sqlserver, and oracle. since oracle is too memory-consuming, it is not useful in the company, let's sort out mysql and sqlserver today.
. Transaction ControlCommit -- end the current transactionRollback -- abort the current transactionSET transaction -- define the data access features of the current transaction
5,ProgramSQLDeclare -- set the cursor for the queryExplain -- describe the data access plan for queryOpen -- open a cursor for retrieving query resultsFetch -- retrieve a row of query resultsClose -- close the cursorPrepare -- prepare SQL statements for dynamic executionExecu
In SQL Server, I often need to perform some time-type field conversions, but I don't quite remember it. So I collected the following sqlserverconvert datetime-related materials and posted them on my site, it is convenient for you to search for it later. I hope it will be helpful to you.
Set the value of the [datetime] field of the table in SQL
New Date Type: is a date type that appears in 2008 that is not in 2005.1,date data type 2,time data type 3, datetime2 data type 4, DateTimeOffset data type1,date data type Date. Format: YYYY-MM-DD Comment: The supported range is from ' 1000-01-01 ' to ' 9999-12-31 '. Its existence avoids the time when we value the data outside of the date 12AMDECLARE @Date as Date SET @Date =getdate () print @Date results: 2017-04-03The 2,time data type is exactly the
resources, causing performance degradation;Http://blogs.msdn.com/b/saponsqlserver/archive/2012/06/15/sql-server-2012-enterprise-editions.aspxThis is the explanation I found on the Internet, excerpts of several paragraphs (I am limited in E-language, translation is not a bad place please forgive me)About SQL Server EE
Tags: data file path seed suitable for production backup strong including synchronizationSummarizeFor our production environment to use automatic seed setting considerations:
Because SQL Server 2016 and 2017 behave differently in disk file path requirements, 2017 can have data files deployed on different volumes
Oracle is not self-growing, but sequences other sequences can be triggered by triggers the trouble is a little bit of the whole thing.
And then I posted the link on my original program string to Oracle.
First the System.Data.SqlClient; reference is changed toSystem.Data.OracleClient;
And get rid of the wrong place in the newspaper. Change from SQL to Oracle
And then I post something that doesn't give an error but
Tags: else count ext obj Write hand string dbi work
SELECT TOP 30000Total_worker_time/ + as [Total CPU time consumed (ms)], Execution_count[Number of runs], Qs.total_worker_time/Qs.execution_count/ + as [average CPU time consumed (ms)], Last_execution_time as [Last Execution Time], Min_worker_time/ + as [Minimum Execution time (MS)], Max_worker_time/ + as [Maximum Execution time (MS)],
SUBSTRING(QT.text, Qs.statement_start_offset/2+1,
( Case whenQs.statement_end_off
Php SQL Server provides a small insight on time and date reading. Last Friday, I wanted to build a php program and connect the mysql database to the SQL Server database. I used to use mysql, but I was not very familiar with SQL Server
TimeStandard Time for mst mdt Mountainous AreasNST standard time for new FinlandPst PDT Pacific Standard TimeYst ydt Yukon Standard Time
Character functions supported by Oracle and Their Microsoft SQL Server equivalent functions:
Functions: Oracle Microsoft SQL ServerConvert characters to ASCIIConcat (expression + expression)Convert ASCII to CHR charReturns the
There have been two recent cases of sending exceptions to SQL Server Database Mail, and these questions are also somewhat interesting, by the way. It is convenient for people who encounter similar problems to be crazy about these problems! Provide a little more ideas.Case 1: One of our database server suddenly send messages are not, when there is a problem, check
I have not configured any results in the domain environment, maybe it is the reason for the domain user. Because I did it in the production environment, changing the domain user requires restarting SQLServer, so this method is abandoned, only certificates can be used.
Environment:
HOST: 192.168.10.2 (Code)
Image: 192.168.10.1 (codenamed B for convenience)
(I have not witnessed the server with limited conditions .) Both servers use SQLServer2005.
Firs
drop table [a] go create table [a] ([ID] int) insert [a] select 1 union allselect 1 union allselect 2 union allselect 3 union allselect null select * from a/* (5 rows affected) ID-----------1123NULL (5 rows affected) */--> test data: [B] if object_id ('[B]') is not null drop table [B] go create table [B] ([ID] int) insert [B] select 1 union allselect 2 union allselect 2 union allselect 4 union allselect null select * from B/* (5 rows affected) ID-----------1224NULL (5 rows affected) */-- merge
In SQL Server 2005 or later versions, the APPLY table operation is added, which greatly facilitates our daily queries.
The new APPLY table operator applies the right table expression to each row in the left table expression. Unlike JOIN, it can calculate the table expression first. APPLY must calculate the left expression logically first. The logic order of input calculation allows the right expression to
SQL server database creation, table creation, and creation Constraints
The following describes SQL server database creation, table creation, and constraints.
-- Before creating the School database: first, determine whether the database exists. If so, delete the database and create it. If not, create the database ---- E
date but not the first date.
When month is used as the date part, datediff returns the number of the first day of the month between two dates (including the second date but not the first date.
When week is used as the date part, datediff returns the number of Sundays between two dates (including the second but not the first.
Overflow value for a smaller unit of time:
Milliseconds 24 days
Seconds 68 years
Minutes 4083
Others has no overflow restrictions
If these limits are exceeded, this functio
server| Microsoft has announced the final functionality and price of the upcoming SQL Server 2005 database, which is mainly divided into developer and Standard editions.
SQL Server Product Management manager Tom Rizzo says Microso
Comparison of common functions of SQL Server and Oracle, sqlserveroracle
--------- Mathematical functions1. Absolute ValueS: select abs (-1) valueO: select abs (-1) value from dual2. INTEGER (large)S: select ceiling (-1.001) valueO: select ceil (-1.001) value from dual3. Round (small)S: select floor (-1.001) valueO: select floor (-1.001) value from dual4. Round (truncation)S: select cast (-1.002 as int) val
. Because no locks are released in read-only database snapshots, database snapshots are an important solution for report solutions.A snapshot instanceNow, let's take a look at how database snapshots work in SQL Server 2005. To do this, first I need a source database as the source of the snapshot. The following script creates a source database:USE masterGOIf exists (SELECT name fromSysdatabases where [name]
])DROP INDEX [clusteredindex_on_fq_fa_636040955802353043] on [dbo].[Entry_head] With (ONLINE = OFF) COMMIT TRANSACTION
Direct F5 operation can be done.
4. Added partition table "New partition boundary" 1, first add file groups and files, for example: GROUP3, and establish a good correspondence relationship 2. New Boundary value
ALTER PARTITION SCHEME fq_fa NEXT used [GROUP3]
‘
syntax ":
ALTER PARTITION Scheme
ALTER PARTITION Function
5. Dele
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.