export this table to XML format. The SQL statement is as follows:The Code is as follows:SELECT1 AS Tag,Null as Parent,SiteName AS [site! 1! Website name],SiteAdd AS [site! 1! Website address],BaiduSort AS [site! 1! Baidu ranking],BaiduShouLu AS [site! 1! Baidu indexing]FROM SiteData order by BaiduShouLu FOR XML EXPLICIT
After running this statement, we can see the following in the running result of
Recently, the date and time format conversion was used to design the database table structure. After a long time, I had to worry about it for a long time. I found that I forgot a lot of things I learned before.
It seems that it is easy to forget that it is not commonly used. Repeat the SQL Server date and time format conversion string. In the
Label:Original: Anatomy of SQL Server 13th integers storage format in row compression and page compression (translated)Anatomy of SQL Server 13th integers storage format in row compression and page compression (translated)http://improve.dk/the-anatomy-of-row-amp-page-compressed-integers/When resolving orcamdf support f
This article by Bole Online-cucr translation, Huang Li-min school draft. without permission, no reprint!English Source: Msiman.ga. Welcome to join the translation team.BackgroundFormatted SQL does not run faster than unformatted SQL. The database may not really care if you put commas in front of or behind each field name. To help you become more sensible and be an efficient
The first online format tool:
Instant SQL Formatter
Features strong, you can set
The second, similar to the first, functions, but only a different UI, SQLPP
The third is for MySQL, is the author from the phpMyAdmin, Php-sql-format, this in my local out of a little problem, complex
Phpmyadmin imports a large amount of data in the SQL statement format. The content of the SQL. php file is as follows :? System (mysql-uroot-pmypassworddatabasea. SQL); printsqlok ;? Root indicates the database user name, and mypassword indicates the content of the SQL. php
Label:Today, there is a very strange problem, directly in the eclipse in the SQL copy, and then paste directly copied in the database will be executed very slowly, but after using PLSQL to format the SQL statement, the speed of execution is very fast, and then my where in the time to determine the ' = ' Both ends are added a space,
The default datetime format of the Chinese version of SQL Server is yyyy-mm-dd thh: mm: Ss. Mmm. For example: Select getdate () 11:06:08. 177 This is inconvenient for people who want to migrate data between different databases or get used to the Oracle Date Format YYYY-MM-DD hh24: MI: Ss. I sorted out the date format
First set up a table:
Copy Code code as follows:
Use [IP]
Go
/****** object: Table [dbo]. [Sitedata] Script Date: 09/11/2010 17:41:11 ******/
SET ANSI_NULLS on
Go
SET QUOTED_IDENTIFIER ON
Go
SET ansi_padding on
Go
CREATE TABLE [dbo]. [Sitedata] (
[ID] [int] IDENTITY (1,1) not NULL,
[SiteName] [varchar] (m) COLLATE chinese_prc_ci_as not NULL,
[Siteadd] [varchar] (MB) COLLATE chinese_prc_ci_as not NULL,
[Baidusort] [INT] Not NULL CONSTRAINT [Df_sitedata_b
server| Convert SQL Server Chinese version of the default Date field datetime format is YYYY-MM-DD Thh:mm:ss.mmm
For example:
Select GETDATE ()
2004-09-12 11:06:08.177
This is somewhat inconvenient for people who are YYYY-MM-DD HH24:MI:SS to transfer data between databases or are accustomed to the Oracle date format.
I've sorted out the date
SQL format () function usage and simple example, sqlformat
The FORMAT () function is used to FORMAT the field display.
SQL FORMAT () syntax
SELECT FORMAT(column_name,
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 Server to '2017-11-07 16:41:35. change 033' to '2017-11-07 00:
I. Time Functions
When using stored procedures and SQL functions, you may encounter time processing. For example, get and add or subtract time. The built-in Time Functions of SQL are used here. I will list these functions to facilitate future memory usage.
-- Getdate: Get the current time Select Getdate () -- Dateadd original time plus: 13:20:16 this time plus 12 months Select Dateadd
The default datetime format of the Chinese version of SQL Server is yyyy-mm-dd thh: mm: Ss. Mmm.
For example:
Select getdate ()
11:06:08. 177
This is inconvenient for people who want to transfer data between different databases or the regular date format YYYY-MM-DD hh24: MI: Ss.
I sorted out the date format conversion
The default datetime format of the Chinese version of SQL Server is yyyy-mm-dd thh: mm: Ss. Mmm.
For example:
Select getdate ()
11:06:08. 177
This is inconvenient for people who want to migrate data between different databases or get used to the Oracle Date Format YYYY-MM-DD hh24: MI: Ss.
I sorted out the date for
Tags: des c style Class A colorWhen you synchronize an Oracle table to SQL Server, you may experience this error when you apply data on the SQL Server side. 2014-05-17 17:20:24 WARNING OGG-01154 SQL error-2147217887 mapping Applsys. Fnd_flex_validation_rules to dbo. Fnd_flex_validation_rules [SQL error-2147217887 (0X80
Use SQL statements to format double data, for example, only two digits after the decimal point are removedOne. Main methods
--Take decimal digits before roundingSelect Left (' 30000.72234 ', charindex ('. ', ' 30000.72234 ')-1)Wherein: CHARINDEX ('. ', ' 30000.72234 ') obtains the position of the decimal point;-1 means all in front of the decimal point, if you want to get the n after the decimal point, w
SQL functions for format conversionConvert (nvarchar (12), @ date, 111 ):
The first parameter represents the length to be intercepted, the second parameter represents the database field, and the last parameter represents the date and time format to be intercepted, as shown in the following table:
Date Format
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.