Forum Replies Created

Viewing 15 posts - 121 through 135 (of 402 total)

  • RE: SQL Dimensions & Fact Tables

    Are you recording history in your Dimension or just adding new records / updating existing records?

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • RE: SQL Dimensions & Fact Tables

    Hi

    Does it make sense to create a clustered primary key on my surrogate column?

    I've always done this as chances are you'll be using these in your joins

    Using SSIS, how would...

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • RE: Annoying join problem & frozen brain.

    Didn't see you had already sorted it!

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • RE: Annoying join problem & frozen brain.

    Like this?

    SELECT * FROM D

    LEFT JOIN (SELECT *

    FROM

    A

    WHERE

    A.b = 1

    ) AS A

    ON D.a = A.B

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • RE: String concatenation

    durai nagarajan (8/20/2012)


    if you want the result like this

    TranIDCode

    201205AMDDOH

    201206IXJRMI

    then the query should be

    select TranID , OriginCode + DestinationCode 'Code' from #Test

    if this is not as per your output post a...

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • RE: Query runs slow

    What indexes are on the tables?

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • RE: Update One Table With Values From Other Table

    Hi

    If you have products in Table2 that do not exist in Table1 and you want NULLS to be populated change the join to a LEFT JOIN

    CREATE TABLE #TEMP

    (Date DATE, Product...

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • RE: need to display All the column from 2 different table

    Difficult to say without knowing your table structures.

    Have you looked into using a FULL OUTER JOIN?

    Cheers

    Andy

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • RE: Roll Up Function

    Which Query?

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • RE: Roll Up Function

    I may be misunderstanding what you are looking for:

    If you would like to elaborate?

    SELECT

    country

    ,region

    ,SUM(Current_Actual_Saving) AS 'Current_Actual_Saving'

    ,SUM(Current_Forecast) AS 'Current_Forecast'

    ,SUM(Current_Metric) AS 'Current_Metric'

    ,SUM(Prior_Actual_Saving) AS 'Prior_Actual_Saving'

    ,SUM(Prior_Forecast) AS 'Prior_Forecast'

    ,SUM(Prior_Metric) AS 'Prior_Metric'

    ,SUM(Prior_2_Actual_Forecast) AS 'Prior_2_Actual_Forecast'

    ,SUM(Prior_2_Forecst)...

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • RE: Can a table have two primary keys?

    No

    You can have a composite PK that consists of two (or more) keys but not two PK's

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • RE: Health Check script for sql server 2005

    Yep, you are 100% correct Derek as far as I'm aware there is no script that will be a 'Catch All'!

    However the OP didn't ask for a Catch All script...

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • RE: Health Check script for sql server 2005

    All credits are in the comments:

    USE master ;

    GO

    IF OBJECT_ID('master.dbo.sp_Blitz') IS NOT NULL

    DROP PROC dbo.sp_Blitz ;

    GO

    CREATE PROCEDURE dbo.sp_Blitz

    @CheckUserDatabaseObjects TINYINT = 1,

    @CheckProcedureCache TINYINT...

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • RE: how to write a function to separate or split function to separate comma separated value in this table?

    Why does 99945678682 not appear in the results?

    Andy

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

  • RE: Include missing days dynamically in SSRS 2008 R2

    Best way of doing this is to join your dataset onto a calendar table in the SQL..

    Andy

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe

Viewing 15 posts - 121 through 135 (of 402 total)