SELECT l.name, l.type_desc, m.name, m.type_desc FROM database1.sys.objects as l full outer join database2.sys.objects as m on m.name = l.name WHERE l.name is null or m.name is null
Thursday, September 18, 2008
Compare schema between two databases
Wednesday, September 3, 2008
Tech Ed 2008
Tech Ed 2008 Day Three - DEV486 C# tips and tricks
- PPTplex
- Enum class to replace
T blah = (T)Enum.Parse(typeof(T), value);
withvar blah = Enum.Parse(value);
See EnumHelper using generics to reduce casting - Codeplex
- Umbrella
- Utilities.NET
IDesign.NET - FormHost Fluent Interfaces E.g. 3.March(2003)- Extension Methods
- static methods in a static class
- Link Bridge
- IEnumerable Extensions
Foreach(Person person in _nodes.OfType<x>(Person)) {} using(TransactionScope scope = new TransactionScope()) { }
- Invariance Checking
- Object Initializer E.g. new DataTable{CaseSensitive=false};
Tech Ed 2008 Day Three - DEV313 Microsoft Visual Studio 2008 IDE tips and tricks
- http://pageofwords.com/blog/2008/09/09/VisualStudioTipsNTricksDEV313.aspx
- Append /nosplash to the end of the shortcut properties to speed up the Visual Studio launch times.
- Tools > Options > Projects and Solutions > General > ...
- Disable save on create
- Track Active Item in Solution Explorer
- Save new projects when created
- Shortcuts:
- Ctrl + shift + space - show parameters again
- Ctrl + shift + f - find in files
- F8 + shift F8 - Edit.Goto Next/Prev Location
- ? - Box selection
- Ctrl + shift + v Clipboard ring
- Ctrl / ">" - Command Window
- Ctrl + F6 - ?
- F11 - Fullscreen
- Object Test Bench
- http://blogs.msdn.com/saraford/
Tech Ed 2008 Day Three - WEB315 Object Oriented MS AJAX
- Everything in Javascript is essentially a HashTable
- String.format() from the AJAX library
- Sys.StringBuilder
- .apply(null, arguments);
- Type.registerNamespace
- Create methods with .prototype
- Delegate
- Events this.raiseEvent('overHeat', {OverMaxSpeed})
Tech Ed 2008 Day Three - SEC201 Do These 10 Things or Get 0wn3d
- identity ≠ authentication
- encryption ≠ integrity
- inspection ≠ intent
- secrecy ≠ trust
- people ≠ technology
- "Defense in depth" = "I am a parrot"
- Stupidity ≠ malice
- Usable ? secure
- Microsoft isn't after world domination... only where there is land
- AES - Advanced Encryption Standard
Tech Ed 2008 Day Three - WEB309 Silverlight 2 for developers
- Silverlight does not normally deal with credentials
- Model View ViewModel
- Presentation Model/Pattern
- Command Pattern to decouple interface from the actions
- Strategy Pattern
- Inversion of Control - Separate code to construct objects
- Windsor, Unity, Ninject
Tuesday, September 2, 2008
Tech Ed 2008 Day Two - WEB317 Explore the new ASP.NET AJAX SP1 Script combining and history controls
- http://www.codeplex.com/ScottCateAjax
- Fiddler
- ScriptManager EnableHistory="true" EnableSecurutyHistoryState Adds __historyFrame
- JS pageLoad() - runs after page fully loaded (or AJAX postback)
- Server
- Combine
- ScriptManager
- ScriptReference
- CompositeScript
- Encrypted by machine key (important to consider for a server farm)
- ScriptProfiler
- Faster load time.
- Script Combining - What's the big deal?
Tech Ed 2008 Day Two - WEB308 Pumping iron: Dynamic languages on .NET
- (Speaker: Harry Pierson)
Tech Ed 2008 Day Two - SOA309 Implementing RESTful Services with Windows communication foundation 3.5 concepts and introduction (Part 1 of 2)
- (Speaker: Rob Ragby)
Tech Ed 2008 Day Two - WEB313 Advanced Cross-Browser layout with Microsoft Internet Explorer 8
- (Speaker: Matt Hellar)
Tech Ed 2008 Day Two - WEB304 Web futures - the next 18 months
- PRISM - Turn a Web Application into a desktop application. Dedicated link and window.
- Ease of use - efficiency Ease of learning
- "Moved my cheese"
- Ways to draw attention using a fear response: Saturated Colour Faces Animation
- http://www.hulu.com
- http://evernote.com/ - onenote for the web. Includes OCR
- Cooliris, formally known as PicLens
Tech Ed 2008 Day Two - SOA305 Getting workflows running and talking in your applications
- (Speaker: Mark Rees)
Monday, September 1, 2008
Tech Ed 2008 Day One - DEV 335 Visual Basic 2008: Developer Productivity
- (Speaker: Nick Randolph)
Tech Ed 2008 Day One - WEB 302 ADO.NET Data Services - The zen of RESTfulness and the Art of "Astoria"
- (Speaker: Scott Hanselman)
Tech Ed 2008 Day One - DAT 302 Overview of SQL Server 2008 - new features
- (Speaker: Jeremy Boyd)
- Auditing to file
- windows application log
- windows security log
- Native Encryption
- Enhanced Mirroring - Auto Page repair and log stream compression
sp_estimate_data_compression_savings ROW/PAGE
Filtered Index
Create Nonclusted index blah on Production.xyz (blah, blah) WHERE PID >= 27 AND PID <= 36;
Resource Governor
(Handles Contention) E.g Limit resources used for reporting. Resource Pools, Workload Groups, Classifier Functions (Which workload group to assign a connection to)
New Data TypesDate, Time, DataTime2 (System clock precision), DatetimeOffset (For use with timezones)
select * from sys.systypes where name like '%date%' or name like '%time%'
SELECT SYSDATETIME() AS SYSDATETIME, SYSDATETIMEOFFSET() as SYSDATETIMEOFFSET, SYSUTCDATETIME() as SYSUTCDATETIME
SELECT SWITCHOFFSET ( '2005-01-20 23:00:00.00000 +4:00', datepard(TZoffset, sysdatatimeoffset())
TODATETIMEOFFSET
- Adds timezone information to a DateTimeOffset.
HierarchyID - supports depth-first and breadth-first indexes. CLR based. Parent.GetDescendant(Child1, Child2) Node.IsDescendantOf() Node.GetLevel GetRoot Node.GetReparentValue(oldParent, newParent)
Grouping Sets - multiple group by clauses
Multirow insert CREATE TABLE tbl_RowCon (PDT VARCHAR(10) PRIMARY KEY, val int) INSERT tbl_RowCon VALUES ('PDT A', 10), ('PDT B', 5), ('PDT C', 10)
+= assignment
Merge Statement insert (DML statement combining multiple operations into one) WHEN MATCHED THEN (so UPDATE) WHEN NOT MATCHED THEN (so INSERT) SOURCE NOT MATCHED (so DELETE)
conditional insert
Table parameters - Readonly when used as a parameter.
- using multiple parameters requires multiple round trips for multirow data.
- temporary tables use disk resources and could be prone to locking. Leads to stored procedure recompilation.
+ offers more flexibility. Well defined scope - won't require locks. Can reduce round trips.
CREATE TYPE EmployeeTableType AS TABLE (EmpID INT, EmpName nvarchar(100))
Spares columns - Generally the column wont have any data
c XML COLUMN_SET FOR ALL_SPARSE_COLUMNS
Values stored in XML will be expanded out to columns.
Large user defined types supported (>8000)
Spatial Data - Vector based. Geometry (Points, line strings, polygons) - Geography (geodetic)
Filestream Storage Attribute on varbinary(MAX) Use when objects are larger than 1MB and provides faster read access. Small objects are often better stored in the database. Exists as a folder on disk as specified - $FSLOG & filestream.hdr (header) .PathName() - filepath of the varbinary(max) column.
Tech Ed 2008 Day One - SOA 205 Extending the application platform with cloud services
- (Speaker: Chris Auld)
Tech Ed 2008 Day One - WEB 301 ASP.NET MVC - Should you care?
- bin deployable (System.Web.Adstractions, System.Web.Mvc, System.Web.Routing)
- Testable via System.Web.Abstractions
- Rely more on convention over configuration (I.e. expected folder structure). The idea being reduced complexity.
One man's magic is another man's convention.
- In the stack trace window in VS 2008 - Show External Code
- The general flow of a page request is controller > model > view > render
- The routing components aren't specific to the MVC web applications.
- MVC Contrib
- NHaml
- Moq
- ASP.NET MVC doesn't use viewstate or postbacks (In the sense of a more traditional ASP.NET web application)
- ZoomIt - Presentation tool
Tech Ed 2008 Day One - Keynote
Live Mesh Folders At first glance it appears to be a internet based file sync tool with the added ability to share the folders with friends and family. All files must be sync'ed up to the online storage, although it also appears to sync directly across the local network.
Remote Desktop There is also the ability to create a type of remote desktop session. Sitting at home on my local network it doesn't appear to make much use of p2p technology as a remote session between my desktop and laptop is painfully slow compared to a standard remote desktop connection.