Forum Replies Created

Viewing 15 posts - 1,816 through 1,830 (of 2,171 total)

  • RE: HELP

    You can use EXISTS keyword.


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

  • RE: Help with update query

    UPDATE      T2

    SET         T2.f3 = T1.f3,

                T2.f4 = T1.f4

    FROM        T2

    INNER JOIN  (

                    SELECT    f2,

                              MAX(f1) f1

                    FROM      T1

                    GROUP BY  f2

                ) q ON q.f2 = T2.f2

    INNER JOIN  T1...


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

  • RE: Convert Table Name [varchar] to Table Type

    What is an "Actual Table Type"?


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

  • RE: want Single table result not in multiple tables in sql server 2000

    Then put an INSERT statement just before my SELECT statement and the case should be closed.


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

  • RE: TSQL PRoblm

    Tadaa!!!!

     

    SELECT   z.part1 + '-' + CONVERT(VARCHAR, z.part2) refNo

    FROM     (

                 SELECT   PARSENAME(REPLACE(refNo, '-', '.'), 2) part1,

                          MAX(CONVERT(INT, PARSENAME(REPLACE(refNo, '-', '.'), 1))) part2

                 FROM     YourTable

                 GROUP BY PARSENAME(REPLACE(refNo, '-', '.'),...


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

  • RE: Filter Data

    declare @test-2 table (empid int, id int, no int, name varchar(100))

    insert @test

    select 1, 123, 111, 'George' union all

    select 1, NULL, 111, 'George' union all

    select 2, 456, 222, 'George' union all

    select 2, 475, 222, 'Raj' union...


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

  • RE: How to use select,alter,insert into select statements one after another in the same batch?

    GO is an execute command for T-SQL

    after a GO, all variables are lost. Just as happens when you execute different queries in QA.


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

  • RE: Join not working

    If you don't have SQL 2005, this might do the trick.

     

    -- prepare test data

    declare @Table1 table (ID int, Number int, DT varchar(10), [Name] varchar(10))

    insert into...


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

  • RE: Joins vs Where

    Also try to put as many comparisons at the JOIN level instead of WHERE level.

    As Gift Peddie writes, that produces smaller resultsets to be joined, and the query will be...


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

  • RE: Do not allow insert if record exists with certain condition

    IF NOT EXISTS (SELECT * FROM MyTable WHERE AcctNo = 'aaa' and code = 'x')

     INSERT INTO MyTable

     (AcctNo, Code)

     SELECT

     'aaa', 'y'

    IF NOT EXISTS (SELECT * FROM MyTable WHERE AcctNo = 'bbb' and...


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

  • RE: Multiple tables, columns with no data

    Of course you have to replace my table vwExchange with the name of the table on your system you want to investigate...

     


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

  • RE: how do i read a log file

    select * from ::fn_dblog(default, default)


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

  • RE: HELP! Creating Custom Primary Key in Trigger during INSERT

    I don't understand what you mean.


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

  • RE: Trigger - Columns_updated() - When is a col updated ?

    The case is

     

    UPDATE SomeTable SET SomeCol = Whatever WHERE 1 = 0

     

    That makes the trigger execute, updating any record that does not exist.

    It is good to check the INSERTED table...


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

  • RE: Divide by zero encountered

    Why would division by zero be better than a division by NULL?

     


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

Viewing 15 posts - 1,816 through 1,830 (of 2,171 total)