Forum Replies Created

Viewing 15 posts - 8,551 through 8,565 (of 10,144 total)

  • RE: How to insert into table based on previous results

    What datatype is account number? That's where your problem is - it's either char or varchar and SQL Server tries to convert it to an int to add the 1....

  • RE: How to insert into table based on previous results

    jbuttery (4/7/2009)


    Thanks for the replies guys. I'll try suggestions. I can do a SELECT, but not sure how to manipulate data and then insert.

    Post the select, Flo will show you...

  • RE: Multi Column Sort

    GSquared (4/7/2009)


    On the same dataset, without updating to zero, the complex Case statement took 8:57 to run.

    I'm missing something and can't figure out what it is! To simplify, here's a...

  • RE: INSERT INTO problem

    pwatson (4/7/2009)


    I'm still not sure... There's something I'm not getting. The new dates and rates are handed to me by management and are not actually in a table within the...

  • RE: How to insert into table based on previous results

    jbuttery (4/7/2009)


    Existing data in row 1

    Col0(Identity)Col1 Col2 Col3 ...

  • RE: Multi Column Sort

    Looks like it needs a little more tweaking - first column is correct sequential order:

    12.353.013.494.254.795.365.826.31

    20.003.594.320.005.210.000.007.12

    30.000.000.005.235.416.336.897.99

    40.005.465.315.920.006.877.340.00

    90.009.469.319.920.0010.8711.340.00

    55.125.666.316.920.007.878.340.00

    70.007.598.320.009.210.000.0011.12

    80.000.000.009.239.4110.3310.8911.99

    130.000.000.0013.2313.4114.3314.8915.99

    It's mighty fast though, a little over one minute on this lappy.

  • RE: INSERT INTO problem

    INSERT INTO EmployeeRates (EmployeeId, Rate, RateDate)

    SELECT EmployeeId, Rate, RateDate

    FROM ...

    Does the result set returned by the SELECT consist of all the rows (and no others) that you want to...

  • RE: INSERT INTO problem

    If you can construct a SELECT which returns the rows which you want to insert into the rates table, then you're almost there. Here's a start:

    SELECT p.PositionId, e.EmployeeId, [new rate],...

  • RE: ERROR: Only one expression can be specified in the select list when the subquery is not introduced with EXISTS

    A Little Help Please (4/7/2009)


    Thanks!!!!!!!!!

    Works! 😀

    and d.account not like 'null%' Are you sure this works?

  • RE: Calc monthly totals along with yearly totals

    Here's the obvious way, using a correlated subquery. Performance will drop dramatically with increasing rowcount.

    -- make some sample data

    DROP TABLE #ODS_GL_TRANSACTION_SUMM

    CREATE TABLE #ODS_GL_TRANSACTION_SUMM (GL_ACCT_ID VARCHAR(16), FISCAL_YEAR_MONTH INT, FISCAL_YEAR INT, MDEBITS...

  • RE: 2 sql statmetns 1 table

    The query you're posted isn't viable. I reckon Markus has figured it out, but if not, here's some sample data which you could use to show the output you expect...

  • RE: select top N records

    sandy (4/7/2009)


    yeah i agree that this is sql2k5 forum

    but thought can get some clue for sql2k but didnt fine even after puttin parenthises

    Hi Sandy

    If you are working with SQL2k then...

  • RE: Multi Column Sort

    Christian Buettner (4/7/2009)


    Hi Chris,

    Very fancy stuff that you posted. Wasn't even aware you could do such fancy stuff in an ORDER BY:-).

    Actually I did want to tell you that your...

  • RE: select top N records

    tnolan (4/7/2009)


    Agreed, wrong section.

    For SQL2008 support for parenthesis though...

    SQL 2008 BOL for TOP - http://msdn.microsoft.com/en-us/library/ms189463.aspx

    Parentheses that delimit expression in TOP is required in INSERT, UPDATE, MERGE, and DELETE statements....

  • RE: select top N records

    tnolan (4/7/2009)


    Actually SQL 2000 does not allow you to paramaterize the TOP clause of a SELECT statement. You need to be running at least SQL 2005 for this, in...

Viewing 15 posts - 8,551 through 8,565 (of 10,144 total)