SQL Server 2005 useful info [includes links to download it]
Note that post #4 contains links for downloading SQL Server Express and various other items, and links to more useful information.
Saw this yesterday - thought it was a really neat T-SQL trick...
Code:
update sometable
set somecol = 'ABC'
OUTPUT inserted.keycol 'Key', deleted.somecol 'Old', inserted.somecol 'New'
where keycol = 1
Will return the 3 columns indicated after the OUTPUT keyword as a SELECT statement after the UPDATE is performed...
Note that the columns come from those "trigger" like tables - the INSERTED and DELETED tables...
I get excited easily ;)
edit: it's only SQL 2005 that will support this
Here's what it looks like:
Code:
begin tran
select * from lettertyp_t where lettertyp='AP'
update lettertyp_t set lettertype='ABC'
OUTPUT inserted.lettertyp 'Key',deleted.lettertype 'Old'
,inserted.lettertype 'New'
where lettertyp='AP'
rollback
comes back with...
Code:
LetterTyp LetterType TDate
--------- ------------------------------ ------------------------------------------------------
AP Acknowledgement of Paternity NULL
(1 row(s) affected)
Key Old New
--------- ------------------------------ ------------------------------
AP Acknowledgement of Paternity ABC
(1 row(s) affected)
Re: SQL Server 2005 useful info
Useful (free) downloads:
SQL Server 2005 Express Edition (SP 1) (a free version of SQL Server!)
SQL Server 2005 Books Online (the help files for all editions of 2005, in various languages)
Management Studio Express. (graphical management tool for the Express Edition).
An unofficial alternative is Toad
Native Client (OLE DB provider and ODBC driver, to make best use of 2005 features from your applications)
Other official downloads can be found here.
And some useful links I've found on my travels, or been told about by forum members:
SQL Server 2005 Features Comparison (compares the features in different Editions)
Video Series: SQL Server 2005 Express Edition for Beginners
Using SQL Server 2005 Express from Visual Basic 6
The Fundamentals of the SQL Server 2005 XML Datatype
Introducing SQL Service Broker Part 1 (messaging between applications and BizTalk). [by our own Sgt-Peppa]
Avoid using the ntext, text, and image data types (Use nvarchar(max), varchar(max), and varbinary(max) instead)
Cross Apply with Table Value Functions
.