Forum Replies Created

Viewing 15 posts - 13,291 through 13,305 (of 14,953 total)

  • RE: Help with SQL Query

    Actually, Joe used ANSI joins. The second query is a cross-join with two Where statements. That's standard.

    (Have to admit, I don't like the layout he used, but that's...

  • RE: Replacing NULL with 0 when using the Pivot operator

    Well, you can do something like this:

    ;with CTE as

    (SELECT *

    FROM #office_info_by_location_id

    PIVOT (MAX(total_offices) FOR month IN ([2008-03],[2008-04])) AS temp)

    select location_name,

    isnull([2008-03], 0) as [2008-03],

    isnull([2008-04], 0) as [2008-04]

    from cte

  • RE: Archive Process - Need opinion

    First, I'd change from using create and update dates to using the timestamp/rowversion data type. Otherwise, if the process ever fails one night (power outage or whatever), it can...

  • RE: Query Performance Difference with Temp Table Scope

    Version 1 has to create a worktable, put the data in there, then move it from the worktable to the temp table. Insert...Exec always works that way, so far...

  • RE: Compile lock problem

    If you can post a copy of the proc, we can probably help you figure out what's causing the recompiles.

  • RE: Key Lock

    This:

    create clustered index guid_index_ind on guid_index (guid)

    Needs to be:

    create unique clustered index guid_index_ind on guid_index (guid)

    That should solve your problem.

  • RE: retrieving unique fields from table into existing Dataset

    CTEs can be used in dynamic SQL scripts. Just has to be SQL 2005, pretty much.

    If you want to look them up in Books Online, search for "Common Table...

  • RE: upgrade from sql2k to sql2k5

    The main advantage to backup-restore vs detach re-attach is that backup-restore only requires you to move one file (the backup file) from one server to the other. If you...

  • RE: VSS For Stored Procedures

    I'm not sure what method you are using to save the scripts, but if you right-click a proc in Management Studio, select Script Stored Procedure as -> CREATE to ->...

  • RE: retrieving unique fields from table into existing Dataset

    Don't do it that way. That turns it into RBAR (Row-By-Agonizing-Row), which will slow it down big time.

    What I meant was something like this:

    ;with NotesTopStamp (TNumber, TopStamp) as --...

  • RE: Errors not caught by TRY CATCH

    Try/Catch can only catch procedural errors. It can't handle compilation errors. That's what you're running into here.

    You'll need to catch the error from the code calling the proc.

  • RE: datetime: 1245-03-05

    GSquared (6/18/2008)


    Front end or insert proc should test for validity.

    This made me think about how I would go about creating a family tree or history database with years outside the...

  • RE: A use for ROWNUMBER() ?

    They would both treat the score of 0 the same way.

    The difference is simply that Rank will skip numbers after ties, while Dense_Rank won't.

    For example, if you have 3 people...

  • RE: Cursors

    liam.stirling (6/18/2008)


    GSquared (6/18/2008)


    Jim, Venky and Mike, run the sample from BOL. The second cursor, the one with the column_details data in it, returns a recordset. You can count...

  • RE: datetime: 1245-03-05

    Front end or insert proc should test for validity.

    This made me think about how I would go about creating a family tree or history database with years outside the range...

Viewing 15 posts - 13,291 through 13,305 (of 14,953 total)