SQL Server days in the current month

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

Program Package SQL Server and enable automatic installation

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

SQL Server Performance Analysis-view the table data page

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 5 transaction, error output, event processing, logging

  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

Export SQL server data dictionary statements (favorites)

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 [some insights on the stored procedures of SQL Server]

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

Comparison Experiment on three paging methods of SQL Server

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.

SQL Server Functions

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

SQL Server obtains the primary key of the specified table.

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

SQL Server Compatibility Level

  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,

SQL Server role

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

Distributed Query essays in SQL Server (sp_addmediaserver, sp_addmediasrvlogin)

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

Obtain the first and last days in SQL Server.

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 (

Common Methods to Improve SQL Server database efficiency

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

SQL Server paging Stored Procedure

Create procedure pagination@ Tblname varchar (255), -- table name@ Strgetfields varchar (1000) = '*', -- the column to be returned@ Fldname varchar (255) = '', -- Name of the sorted Field@ Pagesize Int = 10, -- page size@ Pageindex Int = 1, -- page

-Ms SQL Server 2000 solution to the invalid isolated user and Object Name 'xxx' caused by database backup and Restoration

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

How does SQL Server handle auto-increment columns with letters?

-- 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

SQL Server's null value processing policy

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

Use powershell to set the SQL Server Protocol

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

Usage of midstream targets in SQL Server

Declare @ temp table ( Id int, Lawname nvarchar (10 ), LOGNAME varchar (10 ), Countid int ) Declare @ ID int;Declare @ lawname varchar (50 );Declare @ LOGNAME nvarchar (10 ); Declare mycur cursor(Select ID, lawname, LOGNAME from lawer) -- declares

Total Pages: 923 1 .... 916 917 918 919 920 .... 923 Go to: GO

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.