Forum Replies Created

Viewing 15 posts - 61 through 75 (of 131 total)

  • RE: GOTO and T-SQL

    I found myself using one just the other day, and although it was by far the neatest and most readable option for the logic I was using, I still felt...

  • RE: Heath Normal Form

    Google too (it's been a while since college, and theat's the only time I've really known all the names of things). Of course by now, the top hit on...

  • RE: The Right Kind Of Join

    Paul - that's exactly what I did when BOL didn't quite give enough information to answer.

    I agree with your view on the 2 point question; sorry for doubting you.

    (In real...

  • RE: The Right Kind Of Join

    There would have been less guesswork involved if the full error message had been given instead of just an extract:

    Query processor could not produce a query plan because of the...

  • RE: SELECT and WHERE without FROM

    You don't even need the WHERE clause. I've just done an SSIS step where I needed a single row returned, but didn't care about the contents, so I used

    SELECT...

  • RE: how to find out if we have stored procedures excuted on start up

    If you don't think you have, the easiest way to check is to check the "Scan for Startup Procs" configuration setting. If this is False, then you don't have...

  • RE: Restore Database Failed: 'Exclusive access could not be obtained because the database is in use.'

    Are you doing the restore from SSMS rather than a query? When SSMS opens its restore window, it starts a session using your default database. If this is...

  • RE: Point-in-time restore

    Nakul Vachhrajani (2/15/2011)


    I had to refer BOL for this one because we don't use Bulk-logged mode.

    Sadly, my BOL diving didn't go deep enough. I got to here: http://msdn.microsoft.com/en-us/library/ms189275(SQL.100).aspx, which...

  • RE: SQLCLR

    Koen (da-zero) (2/1/2011)


    A bit easy though, as you can guess the answer just by looking at the names of the DMV. 🙂

    I'm obviously too suspicious. I thought of that,...

  • RE: Issues with IsDate()

    I'm confused as to why you would consider '1753' to be an invalid date (assuming we're using the Julian calendar).

    Datetime datatype runs from 1st January 1753, and the implicit and...

  • RE: Script to find table sizes in a database

    You don't really avoid using cursors or loops - if you have a look inside sp_msforeachtable and sp_msforeach_worker, you'll see it uses them itself.

    For me, the main reason for using...

  • RE: Script to find table sizes in a database

    If you don't mind using undocumented procedures, you can simplify it slightly by replacing all the loop stuff with:

    exec sp_msforeachtable @command1='insert #TempTable exec sp_spaceused ''?'''

    I also convert the "KB" values...

  • RE: SSIS - Deletion in batches

    Are you sure you need an SSIS package?

    Could you use something like this in T-SQL (the variable's not strictly necessary, just makes it easier to change):

    DECLARE @batchSize INT

    SET @batchSize=25000

    WHILE 1=1

    BEGIN

    DELETE...

  • RE: SUMs when joining one to many tables

    I have no idea why I put inner joins in there. In my head they were lefts. 🙂

  • RE: SUMs when joining one to many tables

    As a starter, here's one way you could get the totals you want:

    select a.conName, b.bTotal, c.cTotal

    from #tableA a

    inner join (select conID, SUM(Total) as bTotal from #tableB group by conID) b

    on...

Viewing 15 posts - 61 through 75 (of 131 total)