Forum Replies Created

Viewing 13 posts - 196 through 208 (of 208 total)

  • RE: Converting rows into one column

    In ASA there is a LIST() aggregate function, so the query would be simple as this:

    select FirstName , LastName , list(ContractType) from contrators

    group by FirstName , LastName

    MSSQL does not have...

  • RE: Best Way to Calculate Age

    That's a bug in sqlserver.

    Datediff(m,@birthdate,getdate()) subtracts dates and returns months.

    Datediff(d,@birthdate,getdate()) subtracts dates and returns days.

    Datediff(yy,@birthdate,getdate()) subtracts year parts, contrary to expectations and documentation wich says "Returns the number of intervals...

  • RE: Ways to deal with NULLS.

    Infinity is not a number.

    It's not equivalent to null either. The example was meant just as a method of presentation. To let you understand what is null like. It's...

  • RE: Ways to deal with NULLS.

    In numeric expression think of NULL as infinity (for some expressions) rather than 0, as 0 is an exact value, infinity is not:

    [something] + [infinity] = [infinity]

    [something] * [infinity]...

  • RE: Finding user login information

    K. Brian Kelley (2/15/2008)


    Great in theory, but not necessarily in practice. See my rant:

    A Long Overdue Database Security Rant

    Thumbs up. You're a dba and see this poorly designed app. You...

  • RE: Finding user login information

    'sa' account should be used for administrative purposes only. If a third party application uses sa account, it must be modified to either explicitly ask for user credentials, use windows...

  • RE: How to drop an autogenerated contraint

    Thank you.

    However, it doesn't help me much as is, because I need identify it without knowing the exact name.

    But, I came up with a pretty solution - autogenerated names differ...

  • RE: The Identity Debate

    Every table must have a surrogate key, integer, guid or whatever used for referential integrity. Natural keys must supplement integrity, because:

    1. they're not always available (usually for 10-20% of tables)

    2....

  • RE: about covering indexes

    You rarely need an index for more than few columns. For index to be efficient, it must assure at least partial selectivity, best on most selective column.

    For example, you have...

  • RE: How to abort a transaction?

    That does it. I completely missed the fact that instead of trigger happens before action. There are some restriction on this type of triggers, but better than nothing. Thank you.

    Transactions...

  • RE: How to abort a transaction?

    Thanks, but I'm aware of that. According to "best practices", a trigger should not mess with transactions.

    Besides, a well behaved client gets kicked: starts transaction, executes update, trigger rolls back and...

  • RE: Need Help Sorting

    Create a surrogate column that holds uniform versioninfo that is updated by insert,update trigger. You can use code from previous posts for transformation.

    Unless the table is very small in...

  • RE: query

    SELECT c.CT_Id , c.Category , COUNT(mt.CT_Id) FROM Category c left outer join MasterTransaction mt on mt.CT_Id = c.CT_Id GROUP BY mt.CT_Id

    Since parent categories have no transactions, their count...

Viewing 13 posts - 196 through 208 (of 208 total)