Forum Replies Created

Viewing 15 posts - 1,666 through 1,680 (of 2,171 total)

  • RE: Creating a calculated boolean colum using CharIndex results

    SQL Server will convert the value for you!

    Only zero value will be "BIT" zero. All other values (1, -1, 245, 40000) evaluates as "BIT" 1.

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Puzzler: Three consecutive rows

    -- Prepare sample data

    DECLARE @Appt TABLE (Patient INT, Ser_DT DATETIME,


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Puzzler: Three consecutive rows

    -- Prepare sample data

    DECLARE @Appt TABLE (Patient INT, Ser_DT DATETIME,


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Stored procedure

    You should start a new topic.

    But... One way is to use fully qualified names.

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Insert from cursor

    This can be done with 3 or 4 SET operations.

    With this, you get all year at once!

     

    SELECT

    d.FRSOM_ACCT_KEY,

    d.FRSOM_ORG_KEY


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: How to handle Currency Rate Exceptions

    Yes you did provide expected output, but you did not tell what the rules are!

    I couldn't see a simple way to figure it out.

    Please tell which duplicates to remove and...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: SQL Server Data Retrieval

    This is wrong on so many levels....

     

    Use this query to get all your expected record AT ONCE!

    SELECT

          t2.Entry_Z


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: create record inside a loop

    INSERT Table3 (Field1, Field2)

    SELECT t1.Key, t2.SomeField

    FROM Table1 AS t1

    INNER JOIN Table2 AS t2 ON t2.Key = t1.Key

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: SQL Server Data Retrieval

    Please post your query/code.

    Do you have any [clustered] index on the large table?

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: create record inside a loop

    SELECT t1.Key AS Field1, t2.SomeField AS Field2

    INTO Table3

    FROM Table1 AS t1

    INNER JOIN Table2 AS t2 ON t2.Key = t1.Key

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Query problem

    Too bad you not let other people gain from your success...

    And yes, there is a DELETE POST button when editing the message.

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: create table and exec

    exec ('select * into TempTable from sysdatabases')

    exec ('select * into ##TempTable from sysdatabases')

    If you use single #, the table is not accesible outside the exec statement


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Stored procedure

    And for SQL Server 2005, you have to drop the underscore

    SELECT OBJECT_NAME(@@procid)

     

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Top x records per group

    NO!

    For SQL Server 2005 there are more efficient methods. Read about the ROW_NUMBER() function.

    SELECT * FROM (

    SELECT *, ROW_NUMBER() OVER (PARTITION BY ... ORDER BY ...&nbsp


    N 56°04'39.16"
    E 12°55'05.25"

Viewing 15 posts - 1,666 through 1,680 (of 2,171 total)