Copy Code code as follows:
Using System.Data;
Using System.Diagnostics;
Using System.Data.SqlClient;
String connectionString = "Data source=hg-j3ejj9lsw5py;initial catalog=test; User ID=SA;PASSWORD=HG ";
DataTable datatable =
batch execution of SQL files with Osql/ocmd batch
Note: In the above illustration we can see that osql does not support all the features of SQL Server 2008, and if you need to use all of the features of SQL Server 2008, you can use the Ocmd
Clustered index: Physical storage sorted by indexNonclustered indexes: Physical storage is not sorted by indexAdvantages and DisadvantagesClustered index: Slow to insert data (time spent on "sort of physical storage", which is first to locate and
Suppose there is a student score table (TB) as follows:
Name Subject Result
John Language 74
John Math 83
John Physics 93
Dick Language 74
Dick Math 84
Dick Physics 94
Want to become
Name Chinese mathematics Physics
---------- ----------- ----------
SELECT * FROM table name where Convert (varchar (100), Date field, 23) = ' 2008-12-15 '
And I'll give you the application of the CONVERT function:
Copy Code code as follows:
Select CONVERT (varchar), GETDATE (), 0): 2006 10:57am
There are several treatments for the result set that are worth explaining
1. and set (Union,union all)This is very simple, is to combine two result set level. For example
SELECT * from AUNIONSELECT * from BNote Union deletes duplicate values,
I don't know if the stored procedure can be implemented, but the job scheduler for SQL Server 2000 does have the ability to make certain SQL statements run at regular intervals, and then do the following:Enterprise Manager--Management--sql Server
Fixed server role Description
The sysadmin carries out any activity in SQL Server. The role's permissions span all other fixed server roles.
ServerAdmin Configure server-wide settings.
Setupadmin add and remove linked servers and perform certain
Two Tables Organizational structure table (organise) and payroll history Sheet (wagepermonthhis)
Two tables are associated by organise.item_id and Wagepermonthhis.orgids
Organise table (hereinafter referred to as O table) about 6,000 records in 11
1 annotation CharactersNote refers to the program code does not execute the text string, is a description of the program, you can improve the readability of the program, so that the program code easier to maintain, generally embedded in the program
BeginThis is last year's problem, today in the mail to find this problem, feel the top interesting, special record down.
In table Relationgraph, there are three fields (Id,node,relatednode), where node and relatednode two fields describe the
in the Forum, people often ask questions like :
The result set of the same query is sometimes arranged in the order he wants, sometimes not, or in the order of the SQL2000, and in that order of sql2005/2008?
As a matter of fact, SQL Server does
Several main situations are summarized:
First, how to enter a null valueIf you do not enter a null value, when the time is empty, the default is written to "1900-01-01", which is cumbersome for business processing.
Ctrl+0 You can enter a null
Copy Code code as follows:
--SQL Server 2000
SELECT a.name As field name, case when EXISTS
(SELECT 1
From sysobjects
WHERE xtype = ' PK ' and parent_obj = a.id and name in
(SELECT name
From sysindexes
WHERE Indid in
(SELECT indid
From
How to restore a backup from a backup device (Enterprise Manager)Restore a backup from a backup device
Expand the server group, and then expand the server.
Expand the Databases folder, right-click the database, point to All Tasks submenu, and then
Many friends ask the SQL Server database "Generate script" to export only the SQL scripts for the database, while the table and table data still do not come out. Very simple, look at the tutorial:
Note: I use the SQLServer2008 here, the other
1. Sub-query Concepts(1) is the query in the WHERE clause in the judgment based on the results of another query, so that constitutes an external query and an internal query, this internal query is from the query.(2) Self-query classification1
For a database to have more or less to master, the first basic SQL statements to understand. Here's a summary of some entry-level SQL statements.
Create related
Show Database; Show the existing databaseuse database_x; Now you want to use the
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service