Forum Replies Created

Viewing 15 posts - 136 through 150 (of 326 total)

  • RE: BetterWay to write this proc

    This is what I needed but why CTE? we can only use query used in this CTE, right?

    SQLKnowItAll (6/19/2012)


    Here is the proc:

    USE test

    GO

    CREATE TABLE tab1 (id int,oldId int, InsertedOn datetime)

    insert...

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • RE: BetterWay to write this proc

    Looks like you guys are missing my point. If I run this query, then I'll get only that row which has id=20.

    What I want is complete zigzag chain of...

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • RE: BetterWay to write this proc

    srikant maurya (6/19/2012)


    Try this

    select * from tab1

    order by id

    Where is the passed parameter used in thsi query? it will return everything including id=99, which I dont want when I...

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • RE: Why this behavior for NULL on int col

    GilaMonster (6/8/2012)


    Not at all. Read up on 3-state logic. TRUE, FALSE and UNKNOWN. Any comparisons with NULL (other than IS NULL/IS NOT NULL) return UNKNOWN, not TRUE or FALSE

    WHERE SomeColumn...

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • RE: Why this behavior for NULL on int col

    Despite all the arguments, I still feel that if sql server can not evaluate a condition, then those rows should have been returned instead of preventing them. May be...

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • RE: Why this behavior for NULL on int col

    anthony.green (6/8/2012)


    thats correct as you cannot compare a null value as the result comes back as unknown so is excluded from the result set

    http://msdn.microsoft.com/en-us/library/ms191270%28v=sql.105%29.aspx

    Ok, got your point. So if some...

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • RE: Why this behavior for NULL on int col

    But my where clause is not doing comparision with NULL. it is doing comparision with 0.

    And since NULL is not a zero, those records should come logically.

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • RE: Setting alert when CPU usage 100% for continous 1 minute

    I actually used this proc, and it never gave me a CPU utilization of 100% even though it was 100% for 5 minutes.

    ALTER proc [dbo].[MonitorCPU]

    AS

    BEGIN

    SET NOCOUNT ON

    DECLARE @TimeNow bigint...

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • RE: Setting alert when CPU usage 100% for continous 1 minute

    Honestly I already had tried this query but the DMV doesn't seem to give satisfactory result .

    e.g. I ran a query on test server which made the CPU 100% for...

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • RE: Violation of PRIMARY KEY constraint 'PK_tbl_applicant_skills_test2'. Cannot insert duplicate key in object 'dbo.tbl_applicant_skills_test2'. The duplicate key value is (112).

    First check that the records you are trying to insert exists or not in destination table. You'll find that record there. So you can't insert that record with currect schema....

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • RE: Creating NON clustered during peak load

    ok, so the bottomline is don't create indexes on big table during peak hours.

    Grant Fritchey (5/8/2012)


    In general, this is one of those "Doctor, doctor! It hurts when I do this"...

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • RE: Creating NON clustered during peak load

    Unfortunately the edition was Standard and I couldn't use online option.

    MysteryJimbo (5/8/2012)


    Assuming you have Enterprise edition you can use the CREATE INDEX OPTIONS of ONLINE=ON and SORT_IN_TEMPDB=ON. These are...

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • RE: Executing Errors

    Update to this column shouldn't throw error as this is varchar(20) column and what you are updating is less than 20 chars.

    By the way are you putting quotes in where...

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • RE: Executing Errors

    Then you have either different length of column in table at the machine it worked or you are sending small string...

    did you check from query what is the length of...

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • RE: Query blocking

    Blockings come and go. They are no problem as long as they are not held for long time. You can not remove them completely but your aim should be to...

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

Viewing 15 posts - 136 through 150 (of 326 total)