Commit ac1ed228 authored by O'Reilly Media, Inc.'s avatar O'Reilly Media, Inc.
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading

README.md

0 → 100644
+15 −0
Changes for README.md: 15 added lines, 0 removed lines.
Original line number Diff line number Diff line
## Example files for the title:  
  
# Microsoft SQL Server 2012 Certification - Exam 70-461, by Mark Long
  
[![Microsoft SQL Server 2012 Certification - Exam 70-461, by Mark Long](http://akamaicovers.oreilly.com/images/9781771371834/cat.gif)](https://www.safaribooksonline.com/library/view/title/9781771371834//)
  
The following applies to example files from material published by O’Reilly Media, Inc. Content from other publishers may include different rules of usage. Please refer to any additional usage rights explained in the actual example files or refer to the publisher’s website.
  
O'Reilly books are here to help you get your job done. In general, you may use the code in O'Reilly books in your programs and documentation. You do not need to contact us for permission unless you're reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from our books does not require permission. Answering a question by citing our books and quoting example code does not require permission. On the other hand, selling or distributing a CD-ROM of examples from O'Reilly books does require permission. Incorporating a significant amount of example code from our books into your product's documentation does require permission.
  
We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN.
  
If you think your use of code examples falls outside fair use or the permission given here, feel free to contact us at <permissions@oreilly.com>.
  
Please note that the examples are not production code and have not been carefully testing. They are provided "as-is" and come with no warranty of any kind.
+7 −0
Changes for Working Files/Chapter 1/No Work Files.rtf: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f0\fs24 \cf0 No work files for this lesson...}
 No newline at end of file
+91 KiB

File added.

No diff preview for this file type.

+46 −0
Changes for Working Files/Chapter 10/DELETE Examples.sql: 46 added lines, 0 removed lines.
Original line number Diff line number Diff line
--Let's use SELECT INTO to create a 
--table to run a few DELETE examples
SELECT TOP 25 LastName, FirstName INTO DeleteExample
FROM Person.Person

--Take a look at the new table
select * from DeleteExample

--Let's run a simple, dangerous DELETE query
DELETE FROM DeleteExample
--Oh, no! The message says that 25 rows were deleted!
--We didn't use a WHERE clause...

--Let's reload our table with data using INSERT SELECT
INSERT INTO DeleteExample
SELECT TOP 25 LastName, FirstName FROM Person.Person

--Verify the data was loaded into the table
select * from DeleteExample

--Now let's use DELETE to remove only the records
--for Kim Abercrombie
DELETE FROM DeleteExample
WHERE LastName='Abercrombie' AND FirstName='Kim'




--A trick for using DELETE without being surprised!
--Write the DELETE statement as a SELECT statement 
--Execute it and see how many rows are returned...
--THEN convert it to a DELETE and execute it!
--
--We want to DELETE records for Ben Adams
--So we'll first write the command as a SELECT
SELECT
LastName, FirstName 
FROM DeleteExample
WHERE LastName='Adams' AND FirstName='Ben'

--Looks good, now lets make it a DELETE statement
--Highlight SELECT LastName,FirstName and change it to the following
--then execute it
DELETE
FROM DeleteExample
WHERE LastName='Adams' AND FirstName='Ben'
 No newline at end of file
+141 KiB

File added.

No diff preview for this file type.

Loading