Most SQL Server tables require an index to increase the speed of data access, and if there is no index, SQL Server will be able to scan every record in the table to find the requested data. Indexes can be divided into clustered and non-clustered
Recently discovered Web sites are inaccessible because the database server disk has no more space left. The log file was found to be 70%, and shrinking the log file failed.The reason for the online lookup is that no backup cannot shrink the log file.
Then continue to use the above example to summarize the knowledge points.Filtering with wildcard charactersLike operator //used to select data that is similar or partial to the conditionSelect NameFrom personWhere name like ' Chen ';Result:
SQL Server maintenance plan for database backup (step by Step)First, PrefaceSQL Server Backup and restore all -in-a-kind, including the use of SSMS operation to restore a variety of backup files graphical guidance,SQL Server Database Minimum outage
The DateDiff () function and the GETDATE () function are needed when you are doing SQL Server development and sometimes need to get the data in the table today, yesterday, this week, last week, this month, and last month.DATEDIFF (DatePart,
Create a databasepublic string Createmssql (String dbname, String dbpath){if (! Serviceisexisted ("MSSQLSERVER")){Return "SQL Server has not been properly configured, please install it in a timely manner. ";}if (string. IsNullOrEmpty
The attach database failed for server "WSS_Content". (MICROSOFT.SQLSERVER.SMO)An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)An error occurred while processing the log for database '
1, the common date method (below getdate () = ' 2006-11-08 13:37:56.233 ')(1) Datename (datepart, date)Returns a String that represents the specified date portion of the specified date. DatePart See the list below.SELECT Datename (Day,getdate ()) –
Get one months of days: first to the date of the last day of the one month, by using the SQL Server Date function day () to get the "days" part of the dateNumber of days to get February 2008:Select Day (CAST (' 2008-03-01 ' as DateTime)-1)Get the
To test A. NET system today ~ because the configured database is SQL server~ I have to install SQL Server r2~ Now let's take a look at how SQL Server R2 opens remote connection port 1433. In fact, to open the SQL Server remote connection ~ mainly
Source: Why not a subquery in SQL Server is not recommendedIn SQL Server, subqueries can be divided into correlated subqueries and unrelated subqueries, but not-in clauses are common for unrelated subqueries, but the not-in clause leads to the
To terminate with a stored procedure:Create a terminating database for all successive stored procedures under Query Analyzer, by calling the stored procedure to close all connection operations that use the database.--Create a stored procedure that
Because it has been a trial version, after restarting the server, suddenly the database can not access, prompting the evaluation period has gone, are scared to fright. Fortunately, we found a solution. The special copy resolution steps are as
1) sys.dm_server_services This DMV can tell us the startup status of the services associated with the current version of SQL Server and the time of the last boot, such as this information.SELECT * from Sys.dm_server_services2)
The concept of an indexThe purpose of the index: our data query and processing speed has become a measure of the success of the application system standards, and the use of indexes to speed up data processing speed is often the most commonly used
private static string connstring=configurationmanager.connstrings["ConnString"]. ToString (); Add the appropriate database connection profile to the configuration in app. Config1. Formatting SQL statementsPerform additions and deletions and change
SQL parent node to find all child nodes, SQL parent node
How can we save data in a tree structure? Commonly Used in SQL is the parent node method. Create a table as follows:
CREATE TABLE category ( id LONG, parentId LONG, name String(20) )INSERT
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.