SQL Server date calculation methods (favorites)

Generally, you need to obtain the current date and calculate some other dates, such as your Program You may need to determine the first or last day of a month. Most of you probably know how to divide a date (year, month, day, and so on ), then,

C # list SQL Server servers available in the LAN

Sqldmo is provided by sqldmo. dll of Microsoft SQL Server. Because sqldmo. dll is a COM object, you must add references to it in the. NET project before using sqldmo. dll. Note that the COM reference is added. In the list, find "Microsoft sqldmo

Statements that list all fields with default values in SQL Server

Expert answers By querying three system tables in any database, you can obtain the default values of each field in each table. The following is the core query. It returns the default value allocated to each user table in the current database. This

SQL Server auto-increment Column

Declare @ table_name varchar (60) Set @ table_name = ''; If exists (select top 1 1 from sysobjectsWhere objectproperty (ID, 'tablehasauth') = 1And upper (name) = upper (@ table_name))Select 1Else select 0 -- Or If exists (select top 1 1 from

SQL SERVER deletes duplicate content rows

For repeated row deletion problems, it is difficult to find a suitable answer on the Internet and there are a lot of questions, but there is no solution to the previous record in the search engine. In fact, this problem can be effectively solved. 1

SQLserver2000 Enterprise Edition & quot; process 51 has encountered a serious exception & quot; troubleshooting method

Scenario: It's better to use it all the time. Processing steps: Shut down the firewall such as 360. (This does not affect much, but may be because the anti-virus software processes a key file heal) Installing Microsoft patch

SQL SERVER auto-increment Column

Declare @ Table_name varchar (60) Set @ Table_name = ''; If Exists (Select top 1 1 from sysobjectsWhere objectproperty (id, 'tablehasauth') = 1And upper (name) = upper (@ Table_name))Select 1Else select 0 -- Or If Exists (Select top 1 1 from

SQL Server String Aggregate functions

See the following table: AggregationTable Id Name 1 Zhao 2 Money 1 Sun 1 Li 2 Week If you want to obtain the aggregation result Id Name 1 Zhao Sun

Obtain database growth through backup records

We usually want to know whether the database has grown and how much it has grown. You may think of comparing the sizes of databases in various historical periods.But how can we get these historical data? It seems that there is no good wayI am

Use the like clause in sp_executesql

Declare @ LikeSql nvarchar (32); -- defines a like variable. If it is a stored procedure, the stored procedure parameters can be used here.Set @ LikeSql = 'someword % '; -- assign the LikeSql variable to' % xxxxxxxxxxxx %'Declare @ SelectSql

. NET Framework SQL Server data provider connection pool

You can also provide several connection string modifiers to control connection pool behavior. For more information, see "using connection string keywords to control connection pool" in this topic.Pool creation and allocation When a connection is

If you are familiar with SQL statement operations and want to learn mssql

SQL classification:DDL-Data Definition Language (CREATE, ALTER, DROP, DECLARE)DML-data manipulation language (SELECT, DELETE, UPDATE, INSERT)DCL-Data Control Language (GRANT, REVOKE, COMMIT, ROLLBACK)First, we will briefly introduce the basic

SQL Server connection Error Analysis

SQL Server connection Error Analysis1. "SQL Server does not exist or access is denied"This is the most complex. There are many causes of errors and there are many aspects to check.Generally, there are several possibilities:1. incorrect spelling of

Common ASP database programming SQL skills

1. How to delete columns with repeated fields in a table? For example:Table [table1]Id name1 aa2 bb3 cc1 aa2 bb3 ccI think the last table is like this.Id name1 aa2 bb3 ccAnswer:Save the record to the temporary table # t, save only one record, and

Use SQL Server to obtain the ID of the inserted record (automatic number)

Recently, I encountered a problem in the development project, that is, after inserting a record, I need to immediately obtain the ID in the database, which is auto-incrementing. How can I do this?There are several methods available in SQL server 2005

Solution to the full table scan problem caused by the WHERE variable is null in SQL

Copy codeThe Code is as follows:SET @ SQL = 'select * FROM Comment with (nolock) WHERE 1 = 1And (@ ProjectIds Is Null or ProjectId = @ ProjectIds)And (@ Scores is null or Score = @ Scores )' I remember that when I was doing Oracle development, this

SQL Server EVENTDATA () function to obtain DDL trigger information

Copy codeThe Code is as follows:-- Create a log tableCreate table TriggerLog (LogInfo xml)-- Create a dummy table to delete later onCreate table TableToDelete (Id int primary key)-- Create a new table to delete the experiment table.Insert into

SQL commands-Chinese and English reference page 1/3

SQL commands-Comparison between Chinese and English-- Sentence skill-- Data OperationsSELECT -- retrieve data rows and columns from database tablesINSERT -- add new data rows to the database tableDELETE -- DELETE data rows from a database

Before you reinstall ms SQL Server 2000, you must completely delete the original installation file.

To reinstall ms SQL Server 2000, you usually need to completely delete the original installation file. You can't reinstall it before. By default, it is occupied.Use the following methods to handle installation suspension:1. Enter regedit in start->

Adjust the current initial value of the auto-increment field in SQL Server

A few days ago, when I upgraded the database of a Communtiy Server from SQL 2000 to SQL 2005, I encountered a strange problem and reported the following error:Violation of primary key constraint 'pk _ cs_threads'. Cannot insert duplicate key in

Total Pages: 923 1 .... 345 346 347 348 349 .... 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.