Forum Replies Created

Viewing 15 posts - 391 through 405 (of 1,131 total)

  • RE: Using 'Where' with 'LIKE' 'AND' 'OR' with NULL values mixed in.

    As "Phil Factor" indicated "The database hasn't been normalised" but additionally the search criteria is also an array and arrays cannot be easily manipulated with SQL.

    The solution is to create...

    SQL = Scarcely Qualifies as a Language

  • RE: Auto-Select Database Name

    The command line was truncated:

    isqlw.exe -S SqlServerName -D DatabaseName

    SQL = Scarcely Qualifies as a Language

  • RE: Auto-Select Database Name

    You can also create a shortcut to Query Analyzer that will automatically connect to a specific server and database. The command line is:

    isqlw.exe -S

    You can also add...

    SQL = Scarcely Qualifies as a Language

  • RE: Index Selection

    I would think I would need an index on HISTORY.TYPE and another on PICKLIST.ID because they are used in a join.

    Assumming that a nested loop will be used and HISTORY...

    SQL = Scarcely Qualifies as a Language

  • RE: SQL Best Practices - Universal Checklist

    "How does this work for connecting to named instances?" DNS aliases work for the server name and not for named instances.

    That is why I recommend only one instance per...

    SQL = Scarcely Qualifies as a Language

  • RE: SQL Best Practices - Universal Checklist

    A new category should be security:

    Only grant the minimum privileges necessary including:

    Only DBAs should have any server level roles.

    In development, grant minimum rights (ddl_admin is the highest privilege) and do...

    SQL = Scarcely Qualifies as a Language

  • RE: Baseball Standings Calculating GB

    how can I get it to format the results in typical standings table format

    WP = .xxx

    GB = xx.x

    For Winning Percentage, which is not a percentage but is a rate but...

    SQL = Scarcely Qualifies as a Language

  • RE: Baseball Standings Calculating GB

    As Games Behind is within Division within League, here is a solution. Note that Winning Percentage is defined as a computed column.

    Create table TeamRecord

    (Leaguevarchar(255)not null

    ,Dvarchar(255) not null

    ,TAvarchar(255) not null

    ,Wtinyintnot...

    SQL = Scarcely Qualifies as a Language

  • RE: Updated Can't figure out how to write the query!!

    Without the create table statements, it is not clear how this should be solved, but here is one possibility:

    SELECTtblClientImport.StmtNum

    ,tblStatements.Stmt

    ,tblStatements.Count_Range

    ,tblStmtChar.CharNum

    ,tblCharacteristics.Characteristic

    FROMtblClientImport

    INNER JOIN tblStatements

    ON tblClientImport.StmtNum = tblStatements.StmtNum

    LEFT OUTER JOIN

    tblStmtChar

    on tblStmtChar.SurveyNum = tblClientImport.SurveyNum

    and tblStatements.Count_Range...

    SQL = Scarcely Qualifies as a Language

  • RE: Extract table data and divide by hours

    For a solution, please read "How do I create a cross-tab (or "pivot") query?"

    at http://sqlserver2000.databases.aspfaq.com/how-do-i-create-a-cross-tab-or-pivot-query.html

    SQL = Scarcely Qualifies as a Language

  • RE: Time Calculation

    "stores a time duration as a varchar eg. 00:01:06"

    The problem is the physical datatype used and the that formating is stored. More appropriate would be a numeric datatype such...

    SQL = Scarcely Qualifies as a Language

  • RE: Need variable in ORDER BY clause with Distinct

    Please see "How do I use a variable in an ORDER BY clause?" at

    http://databases.aspfaq.com/database/how-do-i-use-a-variable-in-an-order-by-clause.html

    SQL = Scarcely Qualifies as a Language

  • RE: Need variable in ORDER BY clause with Distinct

    "But put in DISTINCT and it stops working" - actually it gives an error "Server: Msg 145, Level 15, State 1, Line 4

    ORDER BY items must appear in the...

    SQL = Scarcely Qualifies as a Language

  • RE: Tricky Transact SQL

    This appears to be a variation on First-In First-Out allocation such as for allocating Payments to Invoices or for "best fit"

    Someone posted a SQL solution this month but I cannot...

    SQL = Scarcely Qualifies as a Language

  • RE: Detecting Database Append from .NET Application

    Have you looked at SQL Server Notification Services ?

    Under SQL Server 2008, Notification Services is now part of Reporting Services and there is also a new feature named "Change Data...

    SQL = Scarcely Qualifies as a Language

Viewing 15 posts - 391 through 405 (of 1,131 total)