Forum Replies Created

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

  • RE: While loop

    1. Not sure if it works as there are syntactical errors.

    2. You are using one variable for cursor value and another for the 'inner while loop'

    3. In the first...

    ---------------------------------------------------------------------------------

  • RE: Need to get the StoredProcs\Queries used by the sql Jobs in server

    Interview huh?

    USE MSDB

    Select SJS.command

    from msdb.dbo.sysjobs SJ

    JOIN sysjobsteps SJS ON SJ.job_id = SJS.job_id

    WHERE SJ.Enabled = 1

    Order by SJ.NAME DESC

    ---------------------------------------------------------------------------------

  • RE: Need to get list of disable and enable triggers from server

    Another way would be this!

    select CASE OBJECTPROPERTY(OBJECT_ID(name), 'ExecIsTriggerDisabled')

    WHEN 1 THEN 'Disabled'

    ELSE 'Enabled' END as Status

    from sysobjects o

    where o.type='TR'

    ---------------------------------------------------------------------------------

  • RE: While loop

    Can you paste the complete query out here please? (if you can)

    ---------------------------------------------------------------------------------

  • RE: While loop

    Where is the other END and before that you are closing and deallocating cursor?

    while @@fetch_status = 0

    BEGIN

    ---------------------------------------------------------------------------------

  • RE: How to increment the value

    See if this helps, (A recent article on different ways of update)

    http://www.sqlservercentral.com/articles/cursor/68478/

    ---------------------------------------------------------------------------------

  • RE: Summing An Aggregated Column

    I am sure I am miles away from what the solution is (as your requirement was not clear) but an attempt to provide solution.

    Is this what you want?

    Select *, (p_hold/100...

    ---------------------------------------------------------------------------------

  • RE: Problem with select query

    Does this help?

    Select ID, Code, Name,

    STUFF((Select ',' + ContactPerson

    FROM @mytable M2 where M2.ID = M1.ID for xml path('')), 1,1 ,'')

    Amount

    from @MyTable M1

    Group by ID,...

    ---------------------------------------------------------------------------------

  • RE: sp_spaceused for temp tables

    Yes that makes sense,thanks GSquared 🙂

    ---------------------------------------------------------------------------------

  • RE: Can anybody give 5 tips to become a good sql server developer who knows just ABC.

    As per me,

    1. Buy a good book (probably take certification exams so that you cover most of the areas of sql server. Like for eg., 70-431, it helps...

    ---------------------------------------------------------------------------------

  • RE: How to get True /False

    parthi-1705 (12/2/2009)


    In Q2 (File Name) The O/P is False it is incorrect because 13:01:00 to 14:59:00 lies between the Temp table Range of 14:00:00 to 15:00:00

    If we take it...

    ---------------------------------------------------------------------------------

  • RE: How to get True /False

    'Enter' where? you want to enter into the same temp table? This does not help you?

    IF NOT EXISTS( Select 1 FROM @TEMP

    Where FTIME <= @FROMTIME

    AND TTIME...

    ---------------------------------------------------------------------------------

  • RE: DateOf getdate()

    Easy and it depends in what format you want. For the format you've shown try this,

    Select RIGHT(convert(varchar(20), getdate(), 120), 8)

    Edit:Just saw Lynn's post. Thats elegant take that.

    ---------------------------------------------------------------------------------

  • RE: Edit/View a DDL

    From SSMS,

    Server-> databases - > your database -> views ->right click Modify (for graphical representation) or Script view as Alter to New query window for script.

    ---------------------------------------------------------------------------------

  • RE: Edit/View a DDL

    Sorry if I guessed it completely wrong, but when you say DDL, do you mean to say Data Definition Language of an object?

    ---------------------------------------------------------------------------------

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