Tips, micro

Source: Internet
Author: User

1. Pass Chinese parameters through querystring
After the page is redirected, the correct parameter is always not obtained. If it is 2n + 1 Chinese parameter, only 2n can be obtained. Example :? Dept = Office, request. querystring ["Dept"]. tostring () gets "office ". During the transfer, use the system. Web. httputility. urlencode method to convert it.

2. transactions cannot be started in streamline Mode
Modify the data in the database table and press "!". After execution, the database prompts that the transaction cannot be started in streamline mode. It's strange to use Google to search for the cursor. The solution is as follows: drag the scroll bar on the right down until all the data is displayed.
 
3. Get the last day of the month in sqlserver
This is what a netizen asked me. The first reaction is to write it by yourself using the stored procedure.CodeSolution. After a while, he sent a statement. The dateadd function is used:
Select dateadd (DD,-1, dateadd (month, 1, '2017-08-1 '))

Iv. SQL Date Processing
We found that this article was copied during the training of Jia Wei.
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 conversion methods that may be frequently used in SQL Server:

Example:

Select convert (varchar, getdate (), 120)
11:06:08

Select Replace (replace (convert (varchar, getdate (), 120 ),'-',''),'',''),':','')
20040912110608

Select convert (varchar (12), getdate (), 111)
2004/09/12

Select convert (varchar (12), getdate (), 112)
20040912

Select convert (varchar (12), getdate (), 102)
2004.09.12

Other date format conversion methods that are not commonly used:

Select convert (varchar (12), getdate (), 101)
09/12/2004

Select convert (varchar (12), getdate (), 103)
12/09/2004

Select convert (varchar (12), getdate (), 104)
12.09.2004

Select convert (varchar (12), getdate (), 105)
12-09-2004

Select convert (varchar (12), getdate (), 106)
12 09 2004

Select convert (varchar (12), getdate (), 107)
09 12,200 4

Select convert (varchar (12), getdate (), 108)
11:06:08

Select convert (varchar (12), getdate (), 109)
09 12, 2004 1

Select convert (varchar (12), getdate (), 110)
09-12-2004

Select convert (varchar (12), getdate (), 113)
12 09 2004 1

Select convert (varchar (12), getdate (), 114)
11:06:08. 177

Related Article

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.