Forum Replies Created

Viewing 15 posts - 421 through 435 (of 582 total)

  • RE: String manipulation

    replace(replace(@str,',',''),'#','')

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Get no of Rows using system table?

    Or:

    select

    o.name, i.rowcnt

    from sysobjects o

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Make preview of changing rows affect by TSQL Update statment

    I agree that for trivial UPDATEs - those involving just one table instance, you needn't use a FROM clause - except that if you do the SELECT first, you will already have...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Track origin of server-side cursor

    You can track a server cursor by its cursor id which is generated when the cursor is opened, and referenced in all subsequent calls to that cursor. The call to...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Make preview of changing rows affect by TSQL Update statment

    (Jeff-) I agree re writing the SELECT first.

    re using full names for aliased tables, I'm sure I remember that in a previous version you could not reference the base table...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Insert without column name listing

    I versions before 9, I think an insert into a table that has an identity column has to have a column list:

    insert tbl1(col1,col2)
    select 1,2

    So Jules's answer...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: USE OF STUFF

    But if our hapless meat packer discovers he's been given a 2lb beef wrapper for a three pound sirloin, I doubt whether his employer will look kindly on it if he instead wraps...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Make preview of changing rows affect by TSQL Update statment

    I would get in the habit of always using a FROM clause in your updates. then for any UPDATE statement, you can just replace the first part to convert it...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: unique identifier issue between servers

    I don't understand why it would differ between servers, but looking at the code, I notice that this field:

    c.clientid AS CovastID,

    is inserted into this column:

    CovastID VARCHAR(36),...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: CREATE VIEW for sensitive info

    You can write a stored procedure to run the query, which work well if your view represents a finished free-standing query which is going to be returned to client:

    --ultra...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Need help optimizing this Join Fest :)

    Re the previous two posts, the IN subquery will be equivalent to a where clause in the main query (and therefore to an inner join) if and only if FE_Code...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: USE OF STUFF

    Not relevant under the described circumstances, but note odd overflow behaviour of STR():

    select

    str(999,

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: N-Many Relationship

    Normalisation improves OLTP performance, ensures consistency and exposes the true nature of your data model's subject matter.

    Many-to many tables shouldn't just be rgarded as link or join or association tables...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Problem with Sequence Number

    Unless you are going to have unlimited sub-sub-sub-...categories in your item numbers, you would ideally decompose this data into cat, subcat, subsubcat. you could then order properly, as well as...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Coalesce and order by driving me up the wall

    Can you post the data from those three records then?

    Also try running the query with a left join, as a select without variables. Do you get more records?

    You could also...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • Viewing 15 posts - 421 through 435 (of 582 total)