Shrinking logs after SQL Server 2005 mirroring

The site of a database log file has reached the point of 150 g, the data file is dozens of m, through the normal operation to shrink the log:> database right → task → shrink → file, in the popup window, file type select "Log", shrink option Select

SQL Server Notes

How SQL Server sets the primary key auto-increment1: Open SQL Server, connect to the database, locate the target table, right-click, and then tap Design.2: Click the primary key column (or any other column that you want to set for the data type int),

SQL Server Query statements

Use db_buinessGoSelect *from dbo. warehouse WHERE city = ' Beijing 'SELECT DISTINCT (city), warehouse number from dbo. Warehouse//Cancel Duplicate column valuesSelect SUM (wages) as the total wage from the dbo. StaffSelect warehouse number, city,

Read SQL Server database

Private voidQbutton1_click (Objectsender, EventArgs e) {String strconn="server=. \\sqlexpress;uid=sa;pwd=sasa;database=jxcbook"; SqlConnection Conn=NewSqlConnection (strconn); String Sqlid="select * FROM [salesman list]"; Conn. Open ();

C # Connection to SQL Server database error solution

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/54/6D/wKiom1SBw3aA81pLAAF8QwqrRuc897.jpg "title=" Qq20141205223825.png "alt=" wkiom1sbw3aa81plaaf8qwqrruc897.jpg "/>650" this.width=650; "src=" http://s3.51cto.com

SQL Server database Add role, role authorization

Sometimes we need to share data with third parties, but we don't have a completely open database.   Therefore, the use of database role authorization can be a good solution to this problem. The following are the SQL statements used in the work. Just

Back up the SQL Server database

1 , creating a batch file @echo offSet dates=%date:~0,4%%date:~5,2%%date:~8,2%Set rar= "%programfiles%\winrar\winrar.exe"Set rand=%random%Set folder=d:\dbback\%date%REM Creates a folder every day, named after today's dateIf not

SQL Server series: multi-table Connection query

Connection queries are the most important queries in relational data, including inner joins, outer joins, and so on. You can implement multiple table queries by using the Join operator. The INNER JOIN query operation lists the data rows that match

SQL Server series: nested queries

A nested query refers to a query that is nested inside another query statement. A nested query is also a subquery, in which a subquery is evaluated first in the SELECT clause, and the subquery results as a filter for the outer layer of another query,

SQL Server time formatting

1 Declare @i int=12 begin3 while(@i $)4 begin5 BEGINTry6 Print Convert(varchar(3),@i)+' '+Convert(VARCHAR,getdate(),@i)7 ENDTRY8 BEGINCatch9 EndCatchTen Set

MFC: Connecting SQL Server with ADO

1. New dialog box: Ado,: Control ListBox and Button2. Import the ADO library: Import the library in stdafx.h1 " C:\Program Files\Common Files\system\ado\msado15.dll " no_namespace rename ("EOF","rseof")3. Query Button code:1 voidcadodlg::onbtnquery (

SQL Server transfers the physical storage location of the tempdb database

Back up the original file before transferring move tempdb from its current location on disk to a different disk location. Because tempdb is recreated every time the MSSQLSERVER service is started, you do not need to move data and log files

SQL Server series: triggers

Some common uses of triggers:◊ Enforce Referential integrity◊ Common audit trails (Audit trails): This means that the written records not only track most of the current data, but also include historical data that is actually modified for each record.

SQL Server series: Keys and Constraints

1. Types of ConstraintsConstraints can be divided into 3 main categories: Entity constraints, domain constraints, and referential integrity constraints.1.1> entity constraintsEntity constraints are all about comparing rows, and entity constraints do

The combination of SQL Server recursion and function gets the Department collection

Recursive format:With CTE name (field list) as         ( Query Statements          ) Get all subordinate department statements for the current department:Create function getchildrendepartments (@currentdepartid int)Returns tableAsReturnWith CTE

SQL Server use Notes (ii)

Stored ProceduresCREATE PROCEDURE [dbo]. [Getprofitandloss]@agentNo varchar (10),@o0 varchar (30),@source varchar (30),@beginTime varchar (19),@endTime varchar (19)AsDECLARE @FName varchar (2000)//long enoughBEGINSet @FName = ' SELECT agent_no from

The use of SQL SERVER INFORMATION_SCHEMA

-------------------------------------------------------the first query to see how many tables in the library, table names, and so on select * from INFORMATION_SCHEMA. TABLES;-------------------------------------------------------the second query

SQL SERVER 2005 gets all the index information for the table and deletes and creates a new statement

Source: SQL SERVER 2005 gets all the index information for the table and deletes and creates a new statementBEGIN with TX as (SELECT a.object_id, b.name as Schema_name , A.name as TABLE_NAME, c.name as Ix_name, C.is_unique as Ix_

SQL Server row to column

DECLARE @sql varchar (8000), @groupby varchar (8000)SET @sql = ' Select B.name,c.username,c.mobile,a.[no],convert (varchar (ten), a.createdate,121) as CreateDate 'Set @groupby = ' '--Display the grouped columnsSELECT @sql = @sql + ', max (case A.eid

SQL Server creates a database

Today we take some time to learn about SQL Server databases, including how to create databases, create tables, SQL Server data types, data integrity, design databases, SQL Server security models, and T-SQL statements, and so on. I hope you can have

Total Pages: 923 1 .... 820 821 822 823 824 .... 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.