Forum Replies Created

Viewing 15 posts - 106 through 120 (of 132 total)

  • RE: REPEATED RECORDS ( ROWS )

    inner joining to a table allows you to actually select information out of the table you are joining to. using the exists statement simply returns a true or false on...

  • RE: REPEATED RECORDS ( ROWS )

    cannot tell without knowing what your table structures look like and what sample data you are working with where you are seeing records repeated. please post that info and i...

  • RE: Alter Table

    since the column does not exist, sql does not like the drop column statement and that is throwing an error.

    you would want to have your sql that actually does either...

  • RE: T-SQL aggregate quetion

    i did not have any luck putting together one sql statement but i was able to write up a script that you could put into a procedure and then execute...

  • RE: Calling procedure / trigger

    my first thought is that trigger c would not even know how table b was affected, only that it had an event to execute from.

    table b could have been...

  • RE: Updating a field automatically when keying in one field

    i realized that right after i posted, good to know that i had a valid thought for once!

  • RE: Updating a field automatically when keying in one field

    create a computed column in your table. syntax would be similar to below:

    CREATE TABLE Test( field1 int, field2 AS (field1 + 25))
     
  • RE: group by/having not isolating duplicates

    i assumed that you were looking for duplicate reasontext, createdwhen and orderstatuscode records, which appears to be a false assumption.

    without knowing much about the ddl, i am assuming that the...

  • RE: group by/having not isolating duplicates

    your having clause is incorrect, you want the syntax to look like this:

    SELECT     ReasonText, CreatedWhen, OrderStatusCode

    FROM         CV3OrderStatusHistory

    WHERE     (OrderStatusCode = 'perf')

    Group by ReasonText, CreatedWhen, OrderStatusCode

    Having count(*) >1

  • RE: Highlighting duplicate values in one record

    add that condition to the where clause:

    select

    Select Phone1, Phone2, Phone3 from Table

    where (Phone1 = Phone 2

    or Phone1 = Phone3

    or Phone2 = Phone3)

    and ltrim(rtrim(phone1)) <> ''

    and ltrim(rtrim(phone2)) <> ''

    and ltrim(rtrim(phone3))...

  • RE: Monitor changes to table column names

    actually, from looking in the help and actually testing the DDL trigger, the renaming of the column appears to be using the sp_rename stored procedure which in turn uses the...

  • RE: Can I avoid a cursor here?

    one more level would do it (replace testing with your original query)

    select

    x.order_no, x.step, x

  • RE: Can I avoid a cursor here?

    another approach could be something like this where you substitute your orignal query in the inner queries:

    select o.order_no, o.step, o.produced, max(n.step), max(n.produced)

    from

     (select order_no, step, produced

     from your_original_query) o

     left join (select order_no,...

  • RE: searching for specific value within tables

    here is a script that will work but may take a while to process. i am sure that there is an easier way:

    create table #tmp (table_name varchar(50), column_name varchar(50), num_records...

  • RE: searching for specific value within tables

    one question, can only the System_DB column have this database value in it or do you want to look through every column in the database for the 20202...

Viewing 15 posts - 106 through 120 (of 132 total)