Some notes for SQL Server

-------Get table names by field nameSELECT Sb.nameFrom syscolumns s joins sysobjects SB on s.id=sb.idWHERE s.name= ' Your field name 'Left join returns records that include all the records in the left table and the equivalent of the junction fields

SQL Server deletes related views, stored procedures, methods for tables and tables

Note: Before you do this, you need to back up the database before you can delete the error1. Enquiry' %cases% '2. Stitching statementsSELECT'Drop Procedure'+namefrom SysObjects WHERE name like'%cases%'and type='P'; SELECT'Drop View'+namefrom

SQL Server queries database information

use dbnameselect * from sysobjects WHERE (xtype = " u " ) Goxtype can be replaced with the following parameters --c = CHECK constraint --d =--f = FOREIGN KEY constraint --l = log--fn = scalar function --if = inline table function --p = stored

de-SQL Server database usage

UseMasterGoDeclare @dbName nvarchar( -)Set @dbName='Supervise_changchun' --Database nameDeclare @spid nvarchar( -) DeclareCur_lockcursor for SELECT DISTINCTrequest_session_id fromMaster.sys.dm_tran_locksWHEREResource_type= 'DATABASE'

Using with As for recursive functions in SQL Server

Before sqlserver2005, it is cumbersome to implement recursion, for example, you might want to use a temporary table with a while statement to loop. Since sqlserver2005, the new with AS function syntax, the common expression (CTE), makes recursive

SQL Server R2 Column Property modification

1: Add a field to the tableAlter table [table name] add [column name] Type2: Delete FieldAlter table [table name] Drop column [column name]3: Modify the field type in the table (you can modify the type of the column, whether it is empty)ALTER TABLE [

SQL Server C # operations. Original in Collection page

1. Overview 2, the connection string of the wording 3. SqlConnection object 4. SqlCommand object 5. SqlDataReader Object 6. DataSet Object 7. Releasing Resources 1. OverviewADO provides a wealth of database operations

SQL Server finds objects that contain strings

SQL Server finds objects that contain stringsSELECTSm.object_id,object_name(Sm.object_id) as object_name, O.type, O.type_desc, Sm.definition fromSys.sql_modules asSMJOINSys.objects asO onSm.object_id =O.object_idwhereSm.definition like '% of content

SQL SERVER triggers

A trigger is a special kind of stored procedure that is invoked primarily by an event to trigger, and the stored procedure must be called through the name of the stored procedure.First, the definition of triggersA trigger is a special stored

The SQL Server data is displayed in pagination.

1 Select[ID]2 , [Stockapplycode]3 , [Rccode]4 , [Labcentercode]5 , [Labgroupcode]6 , [Labgroupname]7 , [Barcode]8 , [Testsubitemcode]9 , [Testsubitemname]Ten , [CreateDate] One , [Calcrule] A , [Bomtype] - , [Bomconsume] - , [singleconsumepredict]

SQL Server Stored Procedures

Last semester in the company's internship in the company's national map of the project, found that the front-end of the rapid search, statistical analysis and so on is actually called the database server side of the stored procedures or views,

SQL Server 2008 emptying the delete log file

--Instructions for use--HDOCSN is the name of the database to be modified--hdocsn_log is the name of the log file to be purged--Modify all the HDOCSN you see as the name of the database to be purged--Modify the log file name of Hdocsn_log for all

SQL Server Compilation and recompilation

SQL Server Compilation and recompilationMeaning of the compilation When SQL Server receives any one instruction, including query, batch, stored procedure, trigger (trigger), precompiled directives (prepared statement), and dynamic SQL

Simple operation of table data for SQL Server

--Table data manipulation---- Add Table Data ---- adding data to an existing table --[Use the database name to manipulate the data tableGoInsert [into] datasheet [(Field name 1, field name 2, field name 3, ...)] VALUES (value 1, value 2, value 3, ...

The vertical and horizontal tables of SQL Server are transferred to each other

1, longitudinal table turn horizontal tableTABLE_A structure of the longitudinal table:Post-conversion structure:SQL example of a vertical table to a table:SELECT Name,SUM (case when Course = N ' language ' then GradeELSE 0END) as Chinese,SUM (case

SQL Server implements the code of a digital auxiliary table instance.

SQL Server implements the code of a digital auxiliary table instance. The Number Auxiliary table is a continuous integer series, which is usually used to implement multiple different query tasks. Most of them are divided into two categories: a large

After SQL2000 is installed, the SQL Server group has no project solution. sql2000server

After SQL2000 is installed, the SQL Server group has no project solution. sql2000server Yesterday I installed SQL2000, opened the Enterprise Manager, and found that there was no content in the SQL Server group, prompting "no project ". This problem

How does SQL Server View the locked table and how to unlock it?

How does SQL Server View the locked table and how to unlock it? View the locked table: Select spIdfrom master... SysProcesseswhere db_Name (dbID) = 'database name' and spId <>@spidand dbID <> 0 Unlock: Exec ('Kill '+ cast (@ spid as varchar ))

SQL server compilation and recompilation details, SQL server

SQL server compilation and recompilation details, SQL server SQLSERVER compilation and recompilation Meaning of compilation When SQLSERVER receives any command, including query, batch, stored procedure, trigger) Pre-compiled commands (prepared

How to solve the session blocking problem in SqlServer, sqlserversession

How to solve the session blocking problem in SqlServer, sqlserversession Introduction It is common for database O & M personnel to create sessions or query problems. The following describes a very effective method to solve similar problems without

Total Pages: 923 1 .... 801 802 803 804 805 .... 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.