Forum Replies Created

Viewing 15 posts - 3,316 through 3,330 (of 15,381 total)

  • RE: HOW TO ARCHIVE AND DELETE OLD RECORD IN A TABLE THAT HAS NO DATE COLUMN

    deebabat (2/4/2015)


    I have these two tables Log and CategoryLog, I need to archive records older than 13 months in these two tables to two separate tables and then delete the...

  • RE: One table two rows

    djj (2/4/2015)


    So I guess my question is what is the proper way to join one table on itself to get data from two different rows then divide the data?

    That depends...

  • RE: Find Table in a linked server

    Please tell me this isn't something you plan on doing on a regular basis. The performance of something like this is going to be horrendous. If this is just analysis...

  • RE: One table two rows

    djj (2/4/2015)


    What I want is to divide the row value for 'OB Dial Attempts' by the row value for '# Ready To Work Inventory', both in the same table.

    The code...

  • RE: ID or Id

    richxs (2/4/2015)


    I generally use ID if it represents a generated surrogate key, but if the key is a 'real' thing such as an employee ID then I would use employeeID.

    So...

  • RE: Using a column name in a COUNT function

    andycadley (2/4/2015)


    dmcquade (2/3/2015)


    Is there a downside to using the IsNULL function? For example, using the COUNT script when I try:

    SELECT COUNT(IsNULL([Name], ''))

    I get 8 as the result

    It'll probably be slower...

  • RE: Putting Rows together

    CELKO (2/2/2015)


    >> I need some help building a query. I have a table with 4 columns and need to try and put the times together. <<

    And thanks to your bad...

  • RE: incrementing alpha string using SQL

    ChrisM@home (2/2/2015)


    Jeff Moden (2/2/2015)


    My last response on this was nearly a decade ago. I no longer believe that recursion of a scalar function would be the right way to...

  • RE: incrementing alpha string using SQL

    K2mission (2/2/2015)


    Great job, Jan-155192. I'm going to modify to include numerics; ie. 'AAAAAZ' will increment to 'AAAAA0' and 'AAAAA9' would increment to 'AAAABA'. I'll update the post after I'm done...

  • RE: Using a column name in a COUNT function

    DonlSimpson (1/30/2015)


    mark.finch (1/30/2015)


    and what about Count(0) ? Is that the same result as Count(1)?

    ANY literal value, or non-column name value, acts exactly the same as count(*).

    select count(*) from myTable...

  • RE: Using a column name in a COUNT function

    SQLMaister (1/30/2015)


    I think someone wanted to know: what is the best way to determine the number of rows in a query?

    Like I said, there are many ways to answer it,...

  • RE: Trying to create a UDF to query a table on a (random) remote server

    Steve_Wechsler (1/30/2015)


    I'm writing code that will send an alert if a database on a remote server hasn't been backed up recently. A job will run on the local server that...

  • RE: Using a column name in a COUNT function

    SQLMaister (1/30/2015)


    From MS SQL Server help. Also see p 124 of ANSI92 SQL standard.

    Okay, now I want to see a reference where they state that COUNT(1) is better or preferred...

    Syntax

    COUNT...

  • RE: Trying to create a UDF to query a table on a (random) remote server

    Steve_Wechsler (1/30/2015)


    I'm trying to write a function that will retrieve the last backup date/time of a particular database on a remote server (i.e. by querying msdb.dbo.backupset). Unfortunately, you can't use...

  • RE: Using a column name in a COUNT function

    SQLMaister (1/30/2015)


    Yes I can, actually all books and standard reference SQL documents states that COUNT(*) is the correct way. Check it out yourself, look for example in MS Help file,...

Viewing 15 posts - 3,316 through 3,330 (of 15,381 total)