Forum Replies Created

Viewing 15 posts - 1,411 through 1,425 (of 2,007 total)

  • RE: Comparison between two tables

    I don't know about "better", but generally when I'm comparing two algorithms that should produce the same result-set I'd do something like this: -

    SELECT MIN(name) AS TableName, --all columns here

    FROM...

  • RE: Searching smallest unused number

    rahu21 (11/4/2011)


    What about another unspectacular solustion:

    SELECT ISNULL((SELECT TOP 1 RowNumber as FirstUnusedID

    FROM (SELECT ROW_NUMBER() OVER(ORDER BY ID )

    AS RowNumber,ID FROM #testEnvironment2)T

    WHERE RowNumber <> ID

    ORDER BY 1),(ISNULL((SELECT MAX(ID)...

  • RE: Convert Seconds for a given time

    John Mitchell-245523 (11/4/2011)


    I think you'd be best investigating converting your variable to datetime and then using the DATEPART function. But, if you insist on doing it as above, something...

  • RE: Something you could never do in sql server

    foxjazzG (11/3/2011)


    Not in my databases.

    The same could be said by many Oracle DBAs.

  • RE: SQL Server Query Writing Help Needed

    ankita.patel01 81294 (11/3/2011)


    this is fine. thank you for all your help lynn and Cadavre!

    Test all three solutions against your own data, but ColdCoffee's CROSS APPLY is looking unbeatable on my...

  • RE: SQL Server Query Writing Help Needed

    ankita.patel01 81294 (11/3/2011)


    Cadavre,

    I didnt realize the data was doing this until i saw it. Maybe this will help you.

    CREATE TABLE #Account ([Account#] BIGINT, RepCode CHAR(4))

    INSERT INTO #Account

    SELECT 12345678, 'XX01'

    CREATE TABLE...

  • RE: SQL Server Query Writing Help Needed

    ankita.patel01 81294 (11/3/2011)


    Hi Cadavre,

    Thanks for helping with this request. What you have is almost exactly what i want. However, what i found that a lot of the accounts have last...

  • RE: Searching smallest unused number

    TheSQLGuru (11/3/2011)


    1) I LOVE the Celko bashing response! MUCH better than the simple "go away Joe" I was gonna post. 🙂

    Really wasn't my intention to appear to be bashing...

  • RE: SQL Server Query Writing Help Needed

    Hello and welcome to SSC!

    It seems that your DDL script has become detached from your post, or perhaps you were unaware of the benefits of providing one.

    When you have time,...

  • RE: What else have you done?

    Customer service operator for 6 months before getting fired for having no tact (have improved greatly since then, I was 17).

    Bar work (ranging from Bar associate, Bar supervisor, Door supervisor...

  • RE: Percentage calculation

    SELECT ((59459 / 1368003) * 100), --this is 0

    ((59459 / 1368003.0) * 100) --this is 4.346408500

    If you need further prodding, supply DDL please.

  • RE: concatenation of multiple rows

    Teemo (11/3/2011)


    guys i think i did it,

    SELECT nkey,

    (SELECT msg + '|'

    FROM #tmpdata r2

    WHERE r2.nkey = r1.nkey

    ORDER BY msg

    FOR XML PATH('')) AS fmsg

    FROM #tmpdata r1

    GROUP BY nkey

    but my problem is that...

  • RE: Searching smallest unused number

    Thanks guys. The post was more to show future Google searchers the power of the tally table (which I learnt from Jeff's posts and articles :-)) than to correct CELKO....

  • RE: Help on Trigger

    Is your trigger attempting to insert into the identity column?

    Please post the DDL for the tables involved and the triggers.

  • RE: 2 number subtraction in ssis

    Thomas.s (10/31/2011)


    hi,

    thanks for ur help..but i dont want query in sql i want only ssis package mapping in sql server 2008

    That's why I said set it as the dataflow source.

Viewing 15 posts - 1,411 through 1,425 (of 2,007 total)