select getdate () -- current date 17:01:34. 717 select month (getdate ()) -- select day (getdate () of the current month ()) -- the current day of the month is 17 select getdate () - day (getdate () -- last day of last month 17:01:47. 920
1. Prepare the MSDE installation file. There is a setup. ini file under the MSDE directory. The content in the file is changed to the following:[Options]Securitymode = SQLSapwd = saDisablenetworkprotocols = 0The above indicates installation in
Returns the table name, index name, and number of rows.
Select object_name (I. object_id) as objectname, I. [name] As indexname, sum (P. Rows) as rowcnt
From SYS. Indexes I
Inner join SYS. partitions P
On I. object_id = P. object_id
And I. index_id =
SQL Server Bi step by step SSIS 5 (end)--- Transactions, error output, event processing, logging
Like other programs, SSIS packages also require robust and stable operation to ensure reliability and scalability. SSIS provides the following
1. Export the table:
Select top (1, 100) percentCase when a. colorder = 1 then D. Name else ''end as table name, case when a. colorder = 1 then isnull (F. Value ,'')Else ''end as table description, A. colorder as field serial number, A. Name as
Sp_executesql
Execute statements or batch processing that can be reused multiple times or dynamically generated. Transact-SQL statements or batch processing can contain embedded parameters.
[For details, refer to SQL Server online help]
Here is a
Every system cannot avoid list pages, while list pages generally require pagination. Although all languages provide the internal paging function, the efficiency is very poor when there is a large amount of data, especially in the B/S architecture.
1. String Functions
Length and Analysis
Datalength (char_expr) returns the number of characters in the string, but does not contain spaces
Substring (expression, start, length ).
Right (char_expr, int_expr) returns int_expr characters to the right
Sometimes you need to obtain the table primary key field. Although the system can obtain it from a stored procedure, you can easily write it yourself if you are familiar with the system table.
Code highlighting produced by Actipro CodeHighlighter
Error: I gave a demo to my colleague yesterday, which is about sequence usage in enhance T-SQL: Select * From privtdemo sequence (sum ([Mark]) for [course] In ([Chinese], [mathematics], [English]) as PVT usage has the following error
MSG 102,
Server role
Server role
Meaning
Bulkadmin
Execute the bulk insert statement
Dbcreator
Create and Change databases
Diskadmin
Manage Disk Files
Processadmin
Manage processes running in an
due to the diversity of business logic, SQL Server often needs to query data in different databases, which leads to the need for distributed query.
Now I will summarize several types of queries encountered in development as follows:
1. Access
The first and last days of a known year are obtained in the project. I think the network is good and I will leave it as a backup.1. The first day of a month
Select dateadd (mm, datediff (mm, 0, getdate (), 0)
2. Monday of the week
Select dateadd (
In the current Internet application development process, it is often found that the query or operation data speed is slow. There are many causes, which are common:1. No index or no index is used (this is a defect in Database Design)2. Low I/O
When using a database, you often encounter database migration or data migration problems, or sudden database damage. In this case, you need to directly recover from the database backup. However, a problem may occur at this time. Here are several
-- Requirement Description:
/*
Id col
--------------------
Ab00001
Ab00002 B
-- When data is inserted, the ID is automatically changed to ab00003.
*/
-- 1. Calculate the maximum value (this method is not applicable when high concurrency is
Data integrity is any
DatabaseThe focus of the system. No matter how well the system is planned, the problem of NULL data values always exists. This article discusses
SQLThree problems involved in processing these values in server: Count, use empty
Using ing SQL protocols through windows powershell
Sometimes we are asked about the possibility of processing ing SQL Server protocols through powershell. in SQL Server 2008, The sqlps tool incorporates WMI and SMO into this powerful Windows
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