Welcome to EMC Consulting Blogs Sign in | Join | Help

Browse by Tags

All Tags » SQL Server » SQL
Showing page 1 of 3 (24 total posts)
  • DRY SQL

    I recently inherited some SQL that someone else had written and had the job of “tidying it up” before it gets pushed out to production. Here’s a slightly simplified (yes, simplified) version of that SQL: 1: --options 2: select asset_class 3: , case when volume > 0 then 'profit' 4: ...
    Posted to SSIS Junkie (Weblog) by jamie.thomson on July 2, 2009
  • UPDATE FROM the Sybase code museum

    UPDATE FROM is dead … or it should be. Hugo Kornelis has done a good job of explaining why. Apart from a badly thought out and non-portable syntax, UPDATE FROM suffers a notorious bug/feature. I say “notorious” but it’s probably not notorious enough because it is still common to see people get tripped up by it. If I write: UPDATE Alpha SET z ...
    Posted to Data Based (Weblog) by David.Portas on June 24, 2009
  • Getting rid of Getdate()...

    Ok I admit - I use it. Pretty much everyone I know uses it and yet I feel dirty when I do.  Why? Well it's not portable SQL and most certainly not ANSI standard.  I need to get the datetime I hear you say.  How do I do this without getdate()?  There is a perfectly good substitute in the form of CURRENT_TIMESTAMP that is ...
  • Using a Bitmask - a practical example

    A colleague of mine asked for a simple example to get him up and running with the basics of bitmasking.  Since I had gone to the effort to create the example I thought I might as well blog it :o). This example uses the logical AND operator &. First of all you need to define your table.. create table BitmaskDemo (ID int Primary ...
  • Update on T-SQL MERGE

    The MERGE syntax I used here has changed. In 2008 RC0 the ''WHEN SOURCE NOT MATCHED'' clause is replaced with ''WHEN NOT MATCHED BY SOURCE'' which is supposed to make the meaning clearer. Although MERGE is part of standard SQL 2003 it's worth noting that the SOURCE NOT MATCHED / NOT MATCHED BY SOURCE clause is not part of the standard. ...
    Posted to Data Based (Weblog) by David.Portas on June 9, 2008
  • SQL Server 2008 MERGE

    MERGE is a new DML statement in SQL Server 2008. Microsoft have implemented the ISO SQL 2003 and 2007 standard MERGE statement (as seen in Oracle and DB2) and added some extensions of their own. In a nutshell, MERGE allows you to perform simultaneous UPDATE, INSERT and/or DELETE operations on one table. There are new physical operators that ...
    Posted to Data Based (Weblog) by David.Portas on November 14, 2007
  • SQL tutorials and learning resources

    Following a few requests, here are some sites you may find useful for supporting your SQL learning: General http://www.stickyminds.com/  http://www.thefreecountry.com/documentation/onlinesql.shtml (free online tutorials) T-SQL http://sqlcourse.com/ (free online tutorial) http://www.w3schools.com/sql/default.asp (free online ...
    Posted to Jim 2.0 (Weblog) by James.Pipe on November 14, 2007
  • SSAS 2005 - Deployment issues following changes to statically linked measure groups

    If you are making changes to a linked object measure group after you have created the initial link, such as adding a new measure, you can come across the following error when you next deploy the solution. "Errors in the OLAP storage engine: The metadata for the statically linked measure group, with the name of XXX, cannot be verified against ...
    Posted to David Francis Blog (Weblog) by David.Francis on October 3, 2007
  • SSAS 2005 - No mapping between account names and security IDs was done error on deployment

    On the off chance you haven't come across this one before: If you get the following error 'No mapping between account names and security IDs was done' when trying to deploy a cube project then check the membership of all the roles on your cube. Chances are one of the users listed has actually been removed from the Domain. Simply ...
    Posted to David Francis Blog (Weblog) by David.Francis on October 1, 2007
  • A note on Updateable CTEs

    One of my regular gripes about SQL Server concerns the number of Transact SQL features that give nondeterministic results. Unfortunately SQL Server 2005 added to the list of those. One of the new ones is ROW_NUMBER(), which is strictly due to ANSI/ISO rather than Microsoft. ROW_NUMBER() is inherently non-deterministic unless the PARTITION / ORDER ...
    Posted to Data Based (Weblog) by David.Portas on July 26, 2007
1 2 3 Next >
Powered by Community Server (Personal Edition), by Telligent Systems