Forum Replies Created

Viewing 15 posts - 76 through 90 (of 142 total)

  • RE: OR statement issue

    Many options here.

    I would probably first off

    select ...

    where Active = 1

    and that active logic

    UNION ALL

    select ...

    where Active = 0

    and inactive logic

    ORDER BY ...

  • RE: Performance Tuning --- HELP

    you can track this by running profiler over the server / database that is being connected to via the web app.

    you can see the sql in the text data column...

  • RE: Two unrelated procs blocking each other

    check for triggers

    check for tempdb locking (such as creating temp tables with long running queries doing a select ... into #table....)

  • RE: Computed Columns

    I believe I had to actually create the procedures with the appropriate options before the problem was resolved, and not just set them within the procedure.

    SET NUMERIC_ROUNDABORT OFF

    SET ANSI_NULLS ON

    SET...

  • RE: Computed Columns

    One thing that limits the use of persited calculated columns is the many requirements it has, which can be a headache for legacy systems.

    The main issue for legacy code is...

  • RE: Speed Up SELECT DISTINCT Queries

    CREATE TABLE #Test ( fk_tbl_ip_address_id varchar(15) )

    INSERT INTO #Test

    select fk_tbl_ip_address_id

    from tbl_visits

    and startTime between '2007-01-11 00:00:00' and '2008-01-11 23:59:00'

    ...

  • RE: Delete dupes except for most recent

    try this

    DELETE tblEnrollment

    FROM tblEnrollment E

    JOIN tblDupeIDs D ON E.EnrollmentID = D.EnrollmentID

    AND E.UploadDate <> D.MaxUploadDate

  • RE: Adding a raise error when using batch scripts in SQL

    put an errorhandler at the end of the batch script something like

    Do stuff

    call batch script

    IF @rc <> 0

    GOTO ErrHandler

    do more stuff

    GOTO Exit

    ErrHandler:

    ...

  • RE: Stored Procedure executing durations are different between executing from application(web) and SQl server management studio - query window

    you could also add SP:stmt starting / completing to your trace and execute it through the app and see what particular staement within the procedure is causing the delay...

  • RE: Speed Up SELECT DISTINCT Queries

    you could also insert the non distinct hits to a temp table and aggregate against that as a test.

  • RE: Speed Up SELECT DISTINCT Queries

    Some other ideas:

    it sounds like you have to be able to report down to visits per day so you could

    create a reporting table that gets updated each night for...

  • RE: Database Column Tuning

    This snippet was created and posted by someone else who frequents this site. I wish I could remember who to give them credit.

    It might be useful to you.

    --===== Setup the...

  • RE: CURSOR v WHILE for beginners

    For a while loop you could do something like....

    SET NOCOUNT ON;

    DECLARE @PHONEID INT

    DECLARE @PERSONID INT

    DECLARE @PERSLEGACYACCOUNTID INT

    DECLARE @PHONETYPE VARCHAR(40)

    DECLARE @PHONENUMBER VARCHAR(20)

    INSERT INTO #TempPhone ( LoopId int IDENTITY(1,1) NOT NULL,

    PHON_TYPE...

  • RE: group selects

    Some sample data would help... but try this.

    SELECT

    teste.tecnico,

    teste.nome,

    SUM(CASE WHEN teste.setor_dest= 'IRMOT' THEN...

  • RE: Left Join Being Treated as an Inner Join?

    It looks like it is working fine to me.

    DECLARE @EmployeeId uniqueidentifier

    SET @EmployeeId= NEWID()

    INSERT INTO tblemployee VALUES ( @EmployeeId, 'Snow, John' )

    EXEC sp_employeeReviewed @EmployeeId

    SET @EmployeeId= NEWID()

    INSERT INTO tblemployee VALUES ( @EmployeeId,...

Viewing 15 posts - 76 through 90 (of 142 total)