I have never paid attention to writing SQL statements before.
/* Create a database DL */Use masterIf exists (select 1 from Master .. sysdatabases where name = 'dl ')DROP DATABASE DLGo
Use masterGoCreate Database DLOn(Name = dl_data,Filename = 'd:
A Data Analysis System was developed some time ago, using Asp.net + sqlserver 2000. Because the data volume is collected in real time, two or three pieces of data are inserted per second on average. The customer uses the system to analyze the data
SQL Server password Problems
Problem 1: The system logon password is modified, causing sqlserver startup failure.
This is because the sqlserver service is automatically bound to a system account when it is started. This usually happens when a
Sometimes we need to read data one by one, as shown below:
This. sqlconnection1.open ();
Sqldatareader myreader = This. sqlcommand1.executereader ();
Do
{
While (myreader. Read ())
{
Console. writeline ("{0} {1}", myreader. getint32 (0), myreader.
I. Necessity:
MajoritySQL ServerThe table needs to be indexed to speed up data access. If no index is available,SQL ServerYou need to scan the table to read every record in the table to find the requested data. Indexes can be divided into cluster
The Union operator combines two or more query results into a single result set.This result set contains all rows of all queries in the Union query. This is different from using join to combine columns in two tables.
There are two basic rules for
Unable to start Distributed Transaction
I. a. Do not use transactions. Use select statements. Can I perform distributed queries?B. linkserver cannot operate on the local machine when performing distributed update transactions (that is, it cannot
SQL Injection originated from 'or '1' = '1
The most important table name:
Select * From sysobjectsSysobjects ncsysobjectsSysindexes tsysindexesSyscolumnsPolicypesSysusersSysdatabasesSysxloginsSysprocesses
The most important user names (the default
Query all databases
Select [name] from [sysdatabases] Order by [name]
Query all tables in a database
Select [ID], [name] from [sysobjects] Where [type] = 'U'
We all know that [type] = 'U' is a user table, and [type] = 's' is a system table.
Based on
All information of the SQL Server database is stored in its system table. In most cases, the two most useful columns are sysobjects. Name and sysobjects. xtype. The previous one is used to list the names of objects to be evaluated, and the next one
This article uses examples to parse SQL server connection fields ......
Today, icech of Western E wants to export some data of SQL Server. Originally, the year, month, and day are divided into three fields stored in staryear, starmonth, and starday,
SQL code
SQL Server and Excel Data Import and Export 1. query Excel Data in SQL Server: -- ===================================================== ================== select * From OpenDataSource ('Microsoft. jet. oledb.4.0 ', 'Data source = "C:/book1.
Now make sure that the domain user configured in Article 2 has access to this
PublicationSo we need to add this user
SQL ServerAnd can manage and publish this
Publication. Open our
SQL Server, Expand
SecurityFolder and right-click
LoginsSelect
New
SQL backup ------------- 1. SQL database recovery model ‑ 1) full recovery model ----------------- (1) backup of database data files and log files (2) the backup data file copy and all log information of the database are used to restore the database.
Transaction and concurrency
Before learning things and concurrency, we should first understand two concepts:
1. What are things?
Transactions are the basic unit of work in SQL Server. It usually consists of several SQL commands for reading and
SQL Server DBA (Database Administrator, Database Administrator) found that they often use T-SQL to import and process data. Why? Because some data transmission requires the powerful functions of sophisticated SQL. Recently, I just completed another
Set quoted_identifier off
Go
Set ansi_nulls off
Go
Alter procedure cms_searchgetdatabypage
@ Tblname varchar (255), -- table name
@ Fldnames varchar (1000), -- the list of selected fields is separated by commas (,).
@ Selectorderfldname
I have no class this afternoon and I am playing with my computer again. I think of the problem that I did not solve yesterday. I feel a little uncomfortable. I have to solve the problem. ^_^.
I uninstalled the study instance installed yesterday and
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.