In general, we will use the database maintenance plan provided by SQL Server to define the backup.However, sometimes the maintenance plan of some machine databases cannot be successfully backed up.The error cause may be different. In this case, we can use a simple SQL Server backup
I encountered a requirement in my work. I had to query the table structure, index, and primary key, but it was suddenly difficult because the script I wrote for the first time was only compatible with SQL Server 2005, in SQL Server 2000, an error is reported. If it is depres
As the database accumulates over time and experienced developers are different in different styles, the objects in the database are messy. In order to comply with the IT integration trend, improve the maintainability and scalability of the system and database, and decide to integrate the system, database and server
It's just the beginning.
The following is a newly written script that captures and summarizes
server| Script Set conn = Server.CreateObject ("ADODB. Connection ")
Conn.Open "ODBC name", "username", "password"
Sql1= "SELECT * from dbo.sysobjects where type is not in (' S ', ' D ', ' K ')"
Sql1= "SELECT * from dbo.sysobjects where type = ' U '"
Set RSCC = Server.CreateObject ("Adodb.recordset")
Set rs = Server.CreateObject ("Adodb.recordset")
Rscc.open sql1,conn,1,2
Do as not rscc.eof
I like to think of the tools bundled with SQL servers as inverted pyramid. tools for diagnosing and checking general problems are at the top, and tools for finding and diagnosing specific areas of problems are at the bottom. In addition to providing a convenient way to write SQL scripts, the QueryAnalyzer still needs to be used when you need to solve specific SQL
Label:--视图、存储过程、函数名称DECLARE @NAME NVARCHAR(255);--局部游标DECLARE @CUR CURSOR--自动修改未上状态为旷课SET @CUR=CURSOR SCROLL DYNAMIC FORSELECT NAME FROM DBO.SYSOBJECTS WHERE NAME NOT IN (‘SYSCONSTRAINTS‘,‘SYSSEGMENTS‘)AND(OBJECTPROPERTY(ID, N‘IsView‘) = 1 --视图OR OBJECTPROPERTY(ID,N‘IsProcedure‘) = 1 --存储过程OR OBJECTPROPERTY(ID,N‘IsScalarFunction‘) = 1 --标量函数OR OBJECTPROPERTY(ID,N‘IsTableFunction‘) = 1 --标题函数OR OBJECTPROPERTY(ID,N‘IsInlineFunction‘) = 1 --内联函数);OPEN @CUR;FETCH NEXT FROM @CUR INTO @NAMEWHILE (@@FE
Use [Master]GOALTER DATABASEF360dwSETRECOVERY Simple withno_waitGOALTER DATABASEF360dwSETRECOVERY Simple--Simple ModeGO UseF360DWGODBCCShrinkfile (N'F360dw_log', One, Truncateonly)/*--Dnname_log here if you do not know what the name is in Sys.database_files, you can use the following comments to query the statement using the F360dwgoselect file_id, name from sys.database_files; GO*/GO Use [Master]GOALTER DATABASEF360dwSETRECOVERY Full withno_waitGOALTER DATABASEF360dwSETRECOVERY Full --revert t
Problem Description: You want to copy the tables and fields from one database to another database;Method One: A. Generate script file Select Database right button-"task-" Generate script;B. Select a specific database object-"next step;"C. Advanced-"Scripting data type selection architecture and data-" Select the generated script file location-"next;D. Next-"Next"
I like to think of the tools bundled with SQL servers as inverted pyramid. Tools for diagnosing and checking general problems are at the top, and tools for finding and diagnosing specific areas of problems are at the bottom. In addition to providing a convenient way to write SQL scripts, the Query Analyzer still needs to use resources when you need to solve specific SQL
Regular backups of the SQL Server database are often required. Regular backup to this machine, or quite easy, planning tasks can be completed, but if the machine is hung, that backup to this machine is meaningless, then you need to consider backup to the local area network, other computers.
The following is a share of a search on the internet after the simple collation of their own code, with the
In many cases of development, for convenience or commonality of consideration, we first consider the SQL Server database for development, but sometimes the customer's production environment is Oracle or other database, then we need to transform the corresponding data structure and data script to the corresponding database, Data structure in general, the syntax fo
Requirements DescriptionGenerally in the production environment, sometimes need to automatically detect the status of the indicator value, if there is an exception, need early warning, such as e-mail notification, this article is introduced if the power shell to achieve status value monitoringRange of monitoring valuesBased on experience, as a DBA it is generally necessary to monitor the following system performance indicators.CPU: \processor (_total)
SQL Server database Mirroring (i) Single-server mirror script configuration without witnessSQL Server database Mirroring (ii) Full mirroring script configuration in a domain environmentAfter a few days, build the domain, the
Previous note:
Starting with SQL Server 2008, we can easily export data scripts without resorting to stored procedures, but there is a slight difference in the process of exporting scripts for SQL Server 2012 and SQL Server 2008,
Label:1. Batch Processing
Batching refers to a group of statements that contains one or more T-SQL statements that are sent from the application to the SQL Server server at once. The SQL Server
Tags: information help targe zip version gem Service script recommendationThe script has the following points: 1. Major versions of SQL Server, service levels, and version categories 2. installed SP Pack, Cumulative update Cu, historical update of the qfe\ GDR 3. It is recommended that the current SP package can inst
Tags: making a row file path import memory deployment Export data sqlcmd hints ToolsProblem Description:When a client server does not allow direct backup, it is often deployed by exporting database scripts-restoring the database,However, when the database export script is large, when you execute a script with Microsoft SQL
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.