SQL Server Database Basics

1 • Services to control the database Run cmdIn the Control Panel, enter net start MSSQLserver (Start database service)In Control Panel, enter net stop MSSQLserver (Shutdown database service)Enter net continue MSSQLserver (continue database

A simple cursor deletes the SQL Server table

Use DatabaseNameDeclare @tblname char (100)Declare @sql char (5000)Declare table_cursor cursor for select name from sysobjects where name like ' tb_card[_]% ' and name<> ' Tb_card_regi St ' and Name<> ' Tb_card_item ' and name<> ' tb_card_discrule '

SQL Server data full synchronization and value analysis [final version]

SQL Server data full synchronization [Finalize]Copyright, reproduced Please specify the source, thank you! after two days of simultaneous writing and testing, the first release version was made:1. This function only supports one-way synchronization,

Use of SQL Server temporary tables

Use of SQL Server temporary tables DROP table #Tmp--Delete temporary table #tmpCREATE TABLE #Tmp--Creating a temporary table #tmp(ID int IDENTITY (FIRST) NOT null--creates the column ID and adds 1 each time a new record is addedWokno

SQL Server Database cursor options

Background:Cursors control the behavior of server-side cursors, with the associated T-SQL as follows:Declare, open, Fetch, close, deallocate.1.Cursor_close_on_commit{on | off};If set to on closes the open cursor when the transaction commits or rolls

[Go] How to clear the large log file of SQL Server

A valid method is to execute the following script: (Bigdata is the database name) use database name; go alter database database name set RECOVERY Simple; -- Set the simple recovery model go DBCC Shrinkfile (database name _log, 1 go

SQL Server Indexes and views

Ø Index1. What is an indexAn index is a list of data in a data table and a corresponding storage location that can be used to increase the speed of finding data in a table or view.2. Index classificationthe indexes in the database are divided into

Anatomy of SQL Server eighth Orcamdf now supports multi-data file database (translation)

Anatomy of SQL Server eighth Orcamdf now supports multi-data file database (translation)http://improve.dk/orcamdf-now-supports-databases-with-multiple-data-files/Orcamdf one of the newest features is a database that supports multiple data files.

Temporary tables and table variables in SQL Server

In SQL Server performance tuning, there is an unmatched problem: how do you work with temporary datasets in code that takes a long time or is frequently called? Table variables and temporary tables are two choices. Remember that a large number of

On SQL Server triggers

Following the last SQL Server spatial task,The author also received a new task:When the Database property field changes, the spatial data is automatically updated without changing the business code.The first solution that comes to mind is the

SQL Server report garbled with VS Studio 2008

Looking for a half day, did not find there can modify the code. Back again on the Internet search solutions, the answer is few, foggy.Later on the CSDN search on a piece of Crystal report garbled solution, a try, the same can be solved.In fact, it

An instance of SQL Server's index structure

The current index structure for SQL Server is as follows:This is the storage form of the clustered index:Nonclustered indexes are in the following ways:They are stored in the data structure of a B + tree.I believe we have seen similar graphs, but

SQL Server triggers

One, trigger definition and creation:A trigger (trigger) is a special stored procedure whose execution is not invoked by the program or manually, but is triggered by an event, such as when an operation on a table (insert,delete,update) activates it

SQL Server log file Growth reason location

Method 1, sys.databases;--------------------------------------------------------------------------------------------------------------- -------------------------------------------Log file Growth reason:1, the database recovery is not simple, but for

5 ways SQL Server looks at space usage

Workaround:Method 1, sp_spaceusedMethod 2, DBCC SQLPERFMethod 3, DBCC SHOWFILESTATSMethod 4, DBCC SHOWCONTIGMethod 5, Sys.dm_db_partiton_stats------------------------------------------------------------------------------------------------------------

Find SQL Server database history growth information

Most of the time, when we plan the space for a SQL Server database, or space for storage, we need to estimate the size of the required database space, and the simplest way to estimate the future is to look at past trends, which is often the most

SQL Server bulk log file processing

Original: SQL Server bulk log file processingOptimized processing for SqlServer2000, SqlServer2005, SqlServer2008, SqlServer2012, and SqlServer2014 library log files, reducing disk space.Processing method:The following columns are

SQL Server Database Mirroring essay

1. Environment Preparation confirm that two machines have a stable intranet environment with enough bandwidth to have the same version of Windows and SQL Server. Verify that the SQL Server ports for the two machines are open in the firewall

Accumulate SQL Server---SQL statement action constraints

Description--PRIMARY KEY constraint (Primary key constraint): The data of the primary key column is required to be unique and is not allowed to be empty.--Unique Constraint: Requires the column to be unique, allowed to be empty, but only one null

SQL Server in master: Application of Spt_values

Today, when doing data analysis report, encountered a problem like this.The table structure is as follows.Department code, department name, department personnel ID (separated by commas)I want to check out a new dataset by linking to the people table

Total Pages: 923 1 .... 559 560 561 562 563 .... 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.