Forum Replies Created

Viewing 15 posts - 4,501 through 4,515 (of 7,597 total)

  • RE: Need to negate a where clause

    For performance reasons, you should never use ISNULL in a WHERE (or JOIN) clause, because you'll prevent possible index seeks on the underlying column. While the code below is...

  • RE: Number VS Letter

    I'd at least compare the performance of the straightforward brute-force method:

    SELECT

    word AS original_string,

    CASE WHEN SUBSTRING(word, 01, 1) LIKE '[0-9]' THEN SUBSTRING(word, 01,...

  • RE: Need help constructing this SQL Statement, against one table only (table with three columns)

    Something like this might (or might not) perform better, if you need to calc time diff for just those two steps:

    SELECT lst.SNum, lst.SOpDesc, lst.STime,

    CASE WHEN...

  • RE: How to reduce Huge Log File size

    Jeff Moden (12/25/2015)


    ScottPletcher (12/25/2015)


    Jeff Moden (12/24/2015)


    You've confused me a bit, Scott. First you say that 16 VLFs for a 1GB logfile is too low and then you explain using...

  • RE: Cursor or special select statement?

    SELECT c.Cust#, c.Name, c.Address, --c....

    STUFF(

    CASE WHEN cd.Monday = 1 THEN ',Mo' ELSE '' END +

    CASE WHEN cd.Tuesday =...

  • RE: create stored procedure with if condition

    baiju krishnan (12/25/2015)


    when i tried to execute your code following error shown

    Msg 8117, Level 16, State 1, Procedure Sp_Login, Line 19

    Operand data type bit is invalid for max operator.

    Then we'll...

  • RE: How to reduce Huge Log File size

    Jeff Moden (12/24/2015)


    You've confused me a bit, Scott. First you say that 16 VLFs for a 1GB logfile is too low and then you explain using even fewer VLFs...

  • RE: How to use 'like' in a query

    Since Transaction_Date contains the time, a query coded like this:

    Activity.Transaction_Date BETWEEN '20151130' and '20151201'

    Would return rows from 12/01/2015 at exactly midnight (if there were any). But that wouldn't really...

  • RE: How to use 'like' in a query

    select Name.ID, Name.FULL_NAME, Name.FULL_ADDRESS, Name.EMAIL, Activity.ID, Activity.ACTIVITY_TYPE, activity.SOURCE_CODE, activity.TRANSACTION_DATE, Activity.DESCRIPTION

    from Name

    INNER JOIN Activity

    ON Name.ID=Activity.ID

    where Activity.Activity_Type = 'CALL' and SOURCE_CODE = 'BWILSON' and

    Activity.Transaction_Date >= '20151130' and

    Activity.Transaction_Date < '20151201'

    order by Name.ID,...

  • RE: How to use 'like' in a query

    WHERE Transaction_Date >= '20150101' AND Transaction_Date < '20160101'

  • RE: create stored procedure with if condition

    Your code doesn't match your description. Here's code that matches your description.

    For efficiency, I've limited it to a single SELECT from the login table.

    CREATE PROCEDURE [dbo].[Sp_Login]

    @uname nvarchar(20),

    ...

  • RE: How to reduce Huge Log File size

    Jeff Moden (12/23/2015)


    ScottPletcher (12/23/2015)


    Jeff Moden (12/22/2015)


    WhiteLotus (12/21/2015)


    Sounds good ..I also notice that all databases autogrowth option are 10% . Should I change all of them ?

    If the initial size was...

  • RE: Converting and Assigning a Date Variable

    The internal format of date (or datetime or other temporal data type) is not the same as the character format we humans use. In fact, it's just an integer....

  • RE: Trigger doesnot update last record

    Not sure why the "last row" wasn't affected, since that trigger's going to update every row, which you don't want. You need to join to the inserted pseudo-table to...

  • RE: Help with trigger implementation

    CREATE TRIGGER dbo.tr_Question_Details_Update

    ON dbo.tbl_RF_Questions

    AFTER UPDATE

    AS

    --if no rows affected, exit.

    IF @@ROWCOUNT = 0

    RETURN;

    SET NOCOUNT ON;

    UPDATE CS

    SET [ProgramID] = M.ProgramID,

    ...

Viewing 15 posts - 4,501 through 4,515 (of 7,597 total)