SQL Server BASIC Process statements

1. IF ... else (SQL Server does not have end,oracle in it)DECLARE @co INTSET @co = (SELECT COUNT (1) from HGOS_UC.dbo.Emp_Ora_Role Eor WHERE Eor. empid=539 and Eor. DEPID=35)IF @co =0SELECT cr.*From HGOS.dbo.CustomerRM as CRJOIN HGOS_WF.dbo.Task as

Usage of SQL Server cursors

Tag:sqlserver    cursor     declare temp_cursor cursor scroll for    select cityname  from corelinklinshi --  must have an SQL statement here, not empty         open  TEMP_CURSOR    DECLARE  @CityName  varchar ()      

SQL Server Knowledge Rollup

Select @ @servername -- Computer name Select @ @servicename -- Database name Select @ @version -- Select@ @language--Configuration FunctionsSelect getdate() as getdate --Current TimeSelectgetUTCDate () asgetUTCDate--get UTC TimeSelect Day(getdate()

Considerations for modifying the SQL Server service account

=========================================================================If you are modifying the SQL Server database engine and SQL Server Agent service accounts, you can modify them in SQL Server Configuration Manager.Here is an example of

SQL SERVER Database Snapshot

What is a database snapshot?A database snapshot is a read-only static view of the current database.How does a database snapshot work?Once a snapshot of the data is created, the database snapshot is allocated to a free file. When the original page of

SQL SERVER indexing and view learning

The advantages of the index. Creating a unique index ensures the uniqueness of row data, greatly improves data retrieval speed, accelerates the connection between tables, and reduces the time to group and sort in queries when using the order

SQL Server clears the cache, logs the query time

--1. Writes all dirty pages of the current database to disk. A dirty page is a page of data that has been entered into a buffer cache and has been modified but not yet written to disk. -- CHECKPOINT can create a checkpoint that guarantees that all

SQL Server optimizations for DBCC CHECKDB

Method 1,A snapshot of the database before the DBCC CHECKDB is run (the transaction is consistent), the DBCC detects the snapshot, and the DBCC finishes deleting the snapshot.The purpose of the snapshot is to not allow DBCC to request too many locks,

8 ways to back up SQL Server.

Method 1, full backupMethod 2, differential backupMethod 3, partial backup (read_write part of backup database)Method 4, File backupMethod 5, Filegroup backupMethod 6, read-only backupMethod 7, log backup----------------------------------------------

SQL Server Database Restore

1. Log in to the database with SA identity or Windows authentication2. Right click databases Select New Database3. Fill in the database name, select the path (not the default address) for databases files;Choose option to select the recovery model as

SQL Server 2 ways to view the running transaction information.

Method 1, Sys.dm_tran_session_transactions;Method 2, DBCC OPENTRAN--------------------------------------------------------------------------------------------------------------- ---------------------------------------------Method

SQL Server 823,824 Error

First:The 823 error only indicates that SQL Server encountered a WinDOS read or write failure while requesting a page read and write to the operating system. 823 errors occur when a read-write request occursis not related to read and write content. 8

SQL Server views the 4 methods of backup set metadata.

Method 1, Restore LabelonlyMethod 2, RESTORE HEADERONLYMethod 3, RESTORE FilelistonlyMethod 4, Restore Verifyonly--------------------------------------------------------------------------------------------------------------- -------------------------

About one of the system tables in SQL Server sysobjects

  Microsoft SQL Server database is one of the most commonly used database systems in enterprise development management. It is powerful and easy to use. We create databases, tables, views, triggers, stored procedures, functions, and other information

SQL SERVER makes recursive queries

Have the following data sheetIf we want to query all the child nodes of the data with ID 003 We can use the CTE recursive query to complete ...if object_id('TB','N') is not NULL Drop TableTB;Create TableTB (IDvarchar(3), PIDvarchar(3),

SQL Server gets error text information

SQL Server gets error text information, BDE, Adoquery has not been taken, Fdquery canSome DBMS, like SQL Server, return messages as an additional result set. So, to-process messages, the application needs to process multiple result sets. Here's a

An attempt to SQL Server cursors

DECLARE @ProName NVARCHAR (50)DECLARE @CityName NVARCHAR (50)DECLARE @ProId INTDECLARE @CityId INTDECLARE Test_cursor Cursor forSELECT A.areaid,a.areaname,b.areaname from Areafull as a right joins Areafull as B on A.areapid=b.areaid WHERE A.areapid>

Comparison of SQL Server similarity

Transferred from: http://www.dotblogs.com.tw/rachen/archive/2008/10/07/5611.aspxfunction one. To produce a like comparison with a stringCreate functionFN_GET_FUZZY_STR (@instr nvarchar( the) )returns nvarchar(513) as begin /*according to the

SQL SERVER 2008 Notes

1. Database Objects:The database itself IndexesThe transaction logCLR assembliesTables ReportsFilegroupsFull-text CatalogsDiagramsuser-defined Data typesViews RolesStored Procedures Usersuser-defined functionsEncryption Keys2.The Database Object?

The use process of SQL Server full-text retrieval

1. In the SQL Manager, the Full-text index (full text search) item is grayed out in the context menu of the specific table; Workaround: EXEC sp_fulltext_database ' Enable ' 2. How to use full-text search: 2.1. SELECT * FROM tablename

Total Pages: 923 1 .... 912 913 914 915 916 .... 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.