The Sqlserver2005 log file is too large to reduce it by the following methods:
Run the following three lines dbname for the database name:
Backup LOG Dbnamewith No_logBackup LOG Dbnamewith truncate_onlyDBCC Shrinkdatabase (dbname)
Log file
In the work encountered a similar problem: to the Database account permissions to clean up, set up, which has a user test, can only have the database myassistant DML (UPDATE, INSERT, delete, and so on) operation permissions, in addition to the
By default, SQL Server saves 7 ErrorLog files, named:
ErrorLog
Errorlog.1
Errorlog.2
Errorlog.3
Errorlog.4
Errorlog.5
Errorlog.6
In APACS OS version 6.1, the ErrorLog file is saved in the C:\Program Files\Microsoft SQL Server\mssql$wincc\log folder.
How to use SQL Server Tour banner sentences:
Copy Code code as follows:
--Declares a cursor
DECLARE MyCursor CURSOR
For the SELECT Top 5 fbookname,fbookcoding The from tbookinfo//defines a cursor called MyCursor that
Q: Please expert advice! The problem is this: I have 1000 data tables, each with the same structure (each table has "QQ,TJ,YJ,EJ,SJ,SIJ,WJ,LJ,ZS,ZJL" 10 fields), but the table name is different. There is also a "Data Update table JJ
Objects | data | database
Original post content:
How to delete all the data in the database and then reset all the automatic increments?
There are too many tables to complete manually.
http://community.csdn.net/Expert/topic/3094/3094555.xml?temp=.292
A collection of ways of thinking about queries for SQLFor cursors: The way of thinking is line-orientedPerformance: Cursors eat more memory, reduce visible concurrency, lock resources, and moreWhen you have exhausted the while loop, temporal tables,
ALTER proc [dbo]. [COMMON_PROC_TEMP2]As begin declare @id varchar () declare @cbcontractid varchar; DECLARE @ XH int; Declare owner_03_cursor cursor scroll for select ID from cb_contract where canton_id like ' 20% ' --2. Open Cursor Open Owner_
The square brackets represent an object name (view, stored procedure, table, etc.), column name;Normal use, add the same, but if the object name is reserved words, such as cascade, it must be added, but it is recommended not to keep the word as the
Copy Code code as follows:
declare @delStr nvarchar (500)
Set @delStr = ' '--the field string injected here
/****************************************/
/********** The following are operational entities ************/
SET NOCOUNT ON
Copy Code code as follows:
DECLARE @name VARCHAR (25)
DECLARE @SQL VARCHAR (1000)
DECLARE @logid INT
DECLARE sysdatabase_name CURSOR for SELECT name from master.dbo.sysdatabases
OPEN Sysdatabase_name
FETCH NEXT
Copy CodeThe code is as follows:
declare @delStr nvarchar (500)
Set @delStr = ' '--the field string injected here
/****************************************/
/********** The following are operational entities ************/
SET NOCOUNT ON
declare
server| Data | Database 1. 1. Advanced query Statement
1, TRUNCATE TABLE [table_name]
Deletes all rows in a table without recording a single row delete operation.
TRUNCATE table is functionally the same as a DELETE statement without a WHERE clause:
--Shrink SQL log
--exec p_compdb ' test '
Create proc P_compdb
@dbname sysname--The name of the database to compress
@bkdatabase bit=1, because the database may be corrupted in the steps of separating the logs, so you can choose whether to
A crosstab. Use character Deming as the value: the original table data is:
Field 1 Field 2 Field 3
A1 B1 C1
A2 B2 C2
After transformation:
COL1 COL2 COL3
Field 1 A1 A2
Field 2 B1 B2
Field 3 C1 C2
CREATE TABLE tablename (Field 1 varchar (100), Field
Server | scripts | execution
Data-cross-guide for manual execution of related database scripts!
The key point is to establish the connection relationship, the connection established after the implementation of the database-related script
Backup | recovery | data | database
Use SQL language to implement backup/restore functions of the database
Embodies four of the knowledge points in SQL Server:
1. Get the default directory on the SQL Server server
2. Use of Backup SQL statements
Use [test_ythh]
GO
/****** object:storedprocedure [dbo]. [Usp_print_scc_menu] Script date:04/08/2013 11:21:23 ******/
SET ANSI_NULLS on
GO
SET QUOTED_IDENTIFIER ON
GO
——————————–
– Simple Output Sys menu
-byHXL
-20136–
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.