Post: http://msdn.microsoft.com/zh-cn/library/aa992075 (loband). aspxDownload
In learning sql2005, you cannot leave the sql2005 sample database. You can download and install the adventureworks database, download and install the northwind database, and download and install the pubs database. The three libraries of adventureworks, northwind and pubs on Microsoft are hard to find and e-mapreduce is ea
entity will form a one-to-many relational table, such as product price attributes, we want to record all the historical pricing, then the product and price of a one-to-many relationship.In the AdventureWorks database, we can see a lot of this history of record relationship design. Like what:History of employees, departments, shifts:This is an example of a one-to-many relationship mentioned earlier because record history becomes a many-to-many relatio
When you install SQL Server 2005, if you select the default installation, the AdventureWorks database is not installed. Because many tutorials and examples require the use of AdventureWorks databases, it is necessary to install the AdventureWorks database. This article will discuss how to obtain and install this database.
Download and install
Label:1. Download the sample database fileInput URL: http://www.codeplex.com/, search: Microsoft SQL Server Product SamplesDownload the AdventureWorks file for the corresponding database, as an example of "Microsoft SQL Server R2":2. Unzip the file to the corresponding directoryUnzip the downloaded file into: C:\Program Files\Microsoft SQL Server\mssql10_50.mssqlserver\mssql\data directory (if you do not have this directory, create a new one), such as
Label:Recently intended to write a database modeling article, so I intend to analyze Microsoft's official SQL Server sample database AdventureWorks, to see what is worth learning in this database. First we need to download the installation of a SQL Server database engine, and then download the sample database, where the author is sql2008r2, so the download is adventureworks2008r2,: http://msftdbprodsamples.codeplex.com/ You can see this database after
I recently read the fourth edition of "C # Getting Started classic". In chapter 27th, I need to install the rose database in SQL server2005. The example library address in the book is already incorrect. Baidu has some items, but most of them use access databases.
Finally, find an EnglishArticle. It is of great help to download the sample library to install the sample.
Adventureworks Sample Database: http://msftdbprodsamples.codeplex.com/releases/vie
This document uses Ms sql2008 as an example.
1. Download the sample database
Sql2008.adventureworks _ all_databases.x86.msi
Ii. Install the sample database
2.0 enable file stream
Finally, execute the following in the query Analyzer:Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Exec
Sp_configure filestream_access_level,
2
Reconfigure
2.1 enable the full-text filter daemon
a cache plan for each execution of these similar T-SQL statements using noble resources. In addition, by creating a reusable plan, SQL Server also reduces the memory usage required for similar execution plans stored in the cache during the process.
Now let's take a look at the different ways in which SQL Server creates parameterized queries.
How is a parameterized query automatically created?
The person who writes the query optimizer code at Microsoft is doing their best to optimize the w
. How to Use BCP to export data
(1) Use BCP to export the entire table or view.
BCP AdventureWorks. sales. currency out c: \ currency1.txt-c-U "sa"-P "password" -- connect with a password
Or
BCP AdventureWorks. sales. currency out c: \ currency1.txt-c-T -- use a trusted connection
The output result after the preceding command is executed is as follows:
Starting copy...105 rows copied.Network packet size (by
[adventureworks].[ Person]. [Contact] WHERE ContactID in (SELECT EmployeeID from [adventureworks].[ HumanResources]. [Employee] WHERE sickleavehours>68)The results are as follows:In the above query, the subquery that follows the IN keyword returns a column of values to use as the selection criteria for the external query .Similarly, the not-in keyword, which is logically reversed from the In keyword,
field_termSpecifies the delimiter. The default Delimiter is "\ t ".
-R row_termSpecifies the line delimiter. The default value is "\ n ".
-S SERVER_NAME [\ instance_name]Specifies the instance of the SQL Server server to be connected. If this option is not specified, BCP connects to the default instance of the local SQL Server. To connect to the default instance on a machine, you only need to specify the machine name.
-U login_idSpecifies the user name used to connect to the SQL server.
How to Use bcp to export data
1. Use bcp to export the entire table or view.
BCP adventureworks. Sales. Currency out c: \ currency1.txt-c-u "sa"-P "password" -- connect with a password
Or
BCP adventureworks. Sales. Currency out c: \ currency1.txt-c-t -- use a trusted connection
The output result after the preceding command is executed is as follows:
Starting copy...
105 rows copied.
Network packet
delimiter. The default value is "\ n ".-S server_name [\ instance_name]Specifies the instance of the SQL Server to be connected. If this option is not specified, bcp connects to the default instance of the local SQL Server. To connect to the default instance on a machine, you only need to specify the machine name.-U login_idSpecifies the user name used to connect to the SQL server.-P passwordSpecify the username and password used to connect to SQL Server.-TSpecify bcp to log on to SQL Server us
, rather than the default value of this column.
2. How to Use bcp to export data(1) Use bcp to export the entire table or view.
Bcp AdventureWorks. sales. currency out c: \ currency1.txt-c-U "sa"-P "password" -- connect with a password or bcp AdventureWorks. sales. currency out c: \ currency1.txt-c-T -- use a trusted connection
The output result after the preceding command is executed is as follows:
Start
indexed view scripted. --indexes script The indexes (XML and clustered) for each table or indexed view Script
Ed.
--primary-keys Script The primary keys for each table or view scripted. --triggers Script the triggers foR each table or view scripted.
--unique-keys Script the unique keys for each table or view scripted.
--display-progress Display scripting progress.
--enable-toolsservice-logging enable verbose logging. --version Show Program ' s version number and exit Related examples:
Tags: style blog color using IO file data art--piecemeal Restore: Database corruption is relatively large, we have to restore the entire database across multiple data files or even across filegroups.--If the database is particularly large, the database recovery time will be very long. However, we can use the piecemeal restore provided by SQL Server to gradually recover the database. --back up the tail log first:BACKUP LOG [AdventureWorks] to DISK =N'
Install adventure and northwind Sample Database, adventurenorthwind
There are a lot of information on AdventureWorks database installation for help on the Internet. You can also find many answers to this question in baidu and google, but some of the answers are vague. After reading these answers, it is understandable. For example:
1. Download The Adventureworks database from the official website, install th
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.