Indeed, database maintenance is often given to professional database administrators, but as a developer, you may occasionally need to do this work temporarily. So, try these two SQL Server maintenance tips: Easily change the database owner,
1, the wrong delete operation:
--Bad temporary table delete operation because the database is different
IF EXISTS (SELECT * from sysobjects WHERE object_id = object_id (N ' [dbo].[ #tempTable] ') and type in (N ' U '))
Begin
DROP TABLE [dbo].
Problem:
We may often experience the frequent shutdown of SQL Server databases. After analyzing memory and CPU usage, we need to continue to investigate whether the source is in I/O. How do we recognize that SQL Server has I/O-related bottlenecks?
1. CONVERT () function
?
1
CONVERT (data_type (length), Data_to_be_converted,style)
Data_type (length) sets the target data type (with an optional length). Data_to_be_converted contains values that need to be converted.
The first thing you need to do is make sure xp_cmdshell is available. You can choose one of the following two methods to achieve this.
1. You can use sp_configure and execute the following script.
EXEC
server| concept
The page is the most basic data storage unit of SQL Server, with 8KB per page in SQL Server, which means that the SQL Server database has a total capacity of 128 pages per trillion data files.
Type of page: Data, index, text/image,
SQL Server upgrades are an irreversible process that will operate on important systems and data files, with greater risk requiring extra care.
Pre-2.3.1 Upgrade preparation work
To be safe before upgrading, you must make sure that the system is
Server
When you use SQL Server, the log file in the database grows larger and needs to be deleted.
I first separate this database, on the database point right key-> All tasks-> separate the database, after separation, you can delete the Log file,
Server|sql when you suspect that your computer hardware is the primary reason for the performance impact of SQL Server running, you can monitor the load of your hardware with SQL Server Performance Monitor to confirm your guesses and identify system
server|sqlserver| string
Known: Field a= ' F:\photo\Winter leaves.jpg 'Requirements: Segment intercept each character [field a cannot be text type, otherwise error]Workaround:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Server SQL Server-----EXISTS ()
EXISTS
Specifies a subquery that detects the existence of a row.
is a restricted SELECT statement (COMPUTE clauses and into keywords are not allowed). For more information, see the discussion of subqueries in
server| Data | Convert Data Transformation Services for Microsoft SQL Server 2000 (next)
Data pump: Converting data
A DTS Data pump is a DTS object that drives the import, export, and transformation operations of data.
Data pumps are used during
server| Performance | Optimization to maximize SQL Server performance, you must first identify several aspects. When these several aspects are optimized, the whole system performance can be improved to the greatest extent. You can then analyze these
Server when you suspect that computer hardware is the primary cause of the performance impact of SQL Server running, you can monitor the load of the appropriate hardware through SQL Server Performance Monitor to confirm your guesses and identify
Server
Read the picture to PictureBox, then write to the database
SqlConnection conn=new SqlConnection (@ "Data source=chenyuming2004\vsdotnet;uid=sa;pwd=cym;database=lhf");Conn. Open ();SqlCommand cmd=new SqlCommand ("INSERT into fuser values (' 1a
access|server| Export Data
The approach is simple: you need to nest an access connection in a SQL Server connection, and thenWrite to it.Conn.Open "Driver={sql Server};server=mamaco;uid=linner;pwd=123;datAbase=linner "Sql= "SELECT * from Scjh"Set Rs=
Server CREATE PROCEDURE Loginuser
@loginUN Char OUTPUT,
@loginPW Char (40)
As
If @loginPW = (select [Password] from users where Username= @loginUN)
return 0;
Else
return-1;
Go
To Loginun the return value, define it as output, and the
server| Data | database
Simple and practical data reading, data manipulation methods, paste into the program directly call
Read method:
Public DataSet Query (string sqltext){SqlConnection myconnection=new SqlConnection
asp.net|server| Schema | data stored procedures:
/**********************************
Function: Read function record according to certain condition
Author: rexsp
Date Created: 2004-01-13
Modified by:
Date Modified:
*****************************
Best practices
(i) Backup plan
1 2:00:00 A full backup of the database in Sunday every week;
2 every week from Monday to Saturday daily 2:00:00 performs a differential backup of the database;
3 Daily log backups of the database between 8:00:00
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.