Forum Replies Created

Viewing 15 posts - 46 through 60 (of 93 total)

  • RE: Help with Select Statement

    This is really hard to debug without actual data and table structure, and I can't guarantee this will work, but try replacing the Max( Case (Cast(Sbm.Enddatetime).... with the following...

    CASE

          WHEN Sbm.Enddatetime...

  • RE: Trying to get one aggregate set from two different tables

    Oh!  I was trying to do something like this before, but I hadn't given the derived table an alias and I was getting errors.  I just thought this wasn't possible. ...

  • RE: Copy a table?

    I knew I was making it more difficult than it had to be by generating SQL scripts and considering using BCP.    Thanks very...

  • RE: Copy a table?

    Thanks so much!  Had no idea you could insert rows into a table like that.  This is a development server, so I'm not too worried about the performance.  I'll just do...

  • RE: Question of the Day for 11 Dec 2006

    I can't help but agree.  All of us that answered D before the question got fixed should be credited with the correct answer.

  • RE: Tools You Need

    Just wanted to elaborate further on my earlier Beyond Compare post since most of you use SQLCompare from what I can tell.  I did take a look at Red-Gate's website and noticed that all...

  • RE: Tools You Need

    The tool that immediately comes to mind for me is Beyond Compare.  It's one of the best comparison softwares I've seen as it lets you realign code if the compare...

  • RE: Passing Variables down the Sub-subqueries

    Try like this:

    Declare @BeginDate varchar(8)

    Declare @EndDate varchar(8)

    Select @BeginDate = convert(varchar,DateAdd(mm, DateDiff(mm, 0, dateadd(mm, -2, Getdate())),0),112)

    Select @EndDate = convert(varchar,DateAdd(mm, DateDiff(mm, 0, dateadd(mm, -1, Getdate())),0),112)

    Then you can use @BeginDate and @EndDate wherever...

  • RE: CAST problem

    As far as explicitly goes, you can wrap your int with quotes, but that's probably not the best solution.  Or cast your ints to varchars and then compare.  I don't...

  • RE: strip out NULL from recordset and merge

    It looks like the problem is in the Insert on your temporary table.  You are probably inserting multiple rows for each UserId instead of updating an existing row.  You might...

  • RE: Making nice reports

    Dainis,

    You posted in the forum "Anything that is NOT about SQL!"  "NOT" being the keyword.    You might try posting this over at Reporting...

  • RE: T-Sql syntax for concatenating variables

    exec ('[' + @server + '].[' + @db + '].[dbo].spu_procedure ' + @remoteserver + ' = ' + @localServer + ' output')

  • RE: Selecting only the max row

    I would probably use a query similar to this:

    SELECT *

         FROM [Table]

         WHERE [Column] = ( SELECT MAX([Column]) FROM [Table] )

  • RE: Rewriting an update statement without using a cursor

    Never mind.  I did get it on my own.    The following query is the one I'll be using:

    UPDATE D

        SET LicenseStateDifferent = 'Y'

        FROM...

  • RE: Rewriting an update statement without using a cursor

    Looks like the only thing I need to do differently on the query is only update the rows that will have LicenseStateDifferent = 'Y'.  The field is originally defaulted to...

Viewing 15 posts - 46 through 60 (of 93 total)