Forum Replies Created

Viewing 15 posts - 6,871 through 6,885 (of 49,552 total)

  • RE: Stored procedure to load two different tables based on a condition

    Replace AccountMock with AccountChk in both subqueries. I got the table names mixed up.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Sql View to display code descriptions

    Don't use that, it'll be horribly slow. Look for the delimited8kSplit function on this site.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Stored procedure to load two different tables based on a condition

    Open up Books Online. Look at the syntax for a SELECT. Look at the examples on the page. Look at your selects and see what's different.

    Edit: And buy yourself a...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: How to Create a DML trigger

    Tell your manager that a trigger is not the appropriate solution to this. This should be checked in the front end or at the latest in the procedure which does...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Stored procedure to load two different tables based on a condition

    Um.......

    Replace <column list> with the list of columns. It's a place holder.

    And open up Books Online (F1 from in Management Studio) and read over basic SQL syntax for selects...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Stored procedure to load two different tables based on a condition

    If you don't want a tested solution, fine (I'm not spending extra time trying to work out data types and write up insert statements)

    Something like

    INSERT INTO AccountMocktable <column list>

    SELECT <column...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Stored procedure to load two different tables based on a condition

    No, it won't (won't even compile)

    Table definitions (CREATE TABLE ...), sample data (INSERT INTO ...) and expected output please

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Job Failed

    Yes, that will get the job running (although whether that's the only piece of code withe problem is another matter), you still should go back and take all the stuff...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Query

    More readable:

    SELECT DISTINCT

    C1.containerCode,

    C1.containerName,

    (SELECT C1.containerCode AS containerCode,

    ...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Weird Problem

    VARCHAR declared without a length is VARCHAR(1), so any values assigned to that get truncated silently to 1 character.

    p.s. @FromDate and @ToDate should be DATETIME, not strings.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Stored procedure to load two different tables based on a condition

    Table definitions (CREATE TABLE ...), sample data (INSERT INTO ...) and expected output please.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Backup 500GB SQL database and copy across to a remote server, to be restored.

    Jeff Moden (1/5/2015)


    For "only" 500GB, Federal Express works wonders. I did that for a different site several years ago.

    Last time I set up mirroring, 75GB database, 25km away, we...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Job Failed

    Is google broken today?

    https://www.google.com/?q=drop+statistics+sql+server#q=drop+statistics+sql+server

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Job Failed

    zi (1/5/2015)


    any help please

    Patience. I'm posting during lunch break, my job takes priority.

    To be honest, I'd recommend dropping every single thing that DTA created. You should NEVER blindly implement recommendations,...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Job Failed

    DROP VIEW <Name of the View>

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 6,871 through 6,885 (of 49,552 total)