Forum Replies Created

Viewing 15 posts - 46 through 60 (of 80 total)

  • RE: Query Help

    Hello

    so far I got this

    SELECT iSchoolCode ,

    iSchoolYearCode,

    dtCalendarDate ,

    ROW_NUMBER() OVER ( ORDER BY...

  • RE: Query Help

    Sean Lange (2/12/2013)


    This matches your description of your business rules but it doesn't match the data you said you wanted. Not sure which one is correct because you said

    so if...

  • RE: sql job fails --- need help

    anthony.green (1/9/2013)


    Yep that is correct.

    ROLLBACK IMMEDIATE, will force any connections in that databases to stop executing and rollback what they where doing if they where in the middle of a...

  • RE: sql job fails --- need help

    anthony.green (1/9/2013)


    The above will do exactly the same as what you are trying to do, just it is the new way of doing it.

    so it means

    ALTER DATABASE myDB SET SINGLE_USER...

  • RE: sql job fails --- need help

    anthony.green (1/9/2013)


    ALTER DATABASE myDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE

    Thank for Your reply

    but job is failed to step-1 as killed spids

    I need to resolve that.

  • RE: sql job fails --- need help

    anthony.green (1/9/2013)


    What version of SQL are you running?

    What is the purpose of the task at hand, do you just want to boot people out or are you setting the DB...

  • RE: sql job fails --- need help

    anthony.green (1/9/2013)


    sp_dboption is a depreciated feature, user alter database instead

    ALTER DATABASE myDB SET SINGLE_USER

    Thanks for reply

    It was my bad

    actual script is as below

    declare @spid varchar(2)

    declare @execstat nvarchar(10)

    declare kill_cursor cursor

    for...

  • RE: Query Help

    Jason-299789 (1/3/2013)


    Ok, I didnt realise there was any other logic.

    This is a way to do it with a Left Join

    Select t2.*

    from #temp2 t2

    Left Join #temp1 t1 on t2.StudentLocalID=t1.StudentLocalID...

  • RE: Query Help

    Jason-299789 (1/2/2013)


    this should work

    Select * from #temp2

    EXCEPT

    Select * from #temp1

    Thanks for your help

    can you please solve another way, so i can implement that in my real logic.

    Thanks For Your Help

  • RE: Query Help

    Sean Lange (12/21/2012)


    Here is another way.

    select t.* from #temp t

    join #temp t2 on t.cStudentID = t2.cStudentID

    where t2.cCurrentGradeCode <> '99' or t2.cAnticipatedGradeCode <> '99'

    order by t2.cStudentID

    Great !!!

    Thank You so Much

  • RE: SQL Job stuck and running for Long Time

    nigelrivett (12/7/2012)


    Does the SP do anything outside sql server?

    Send emails, run dos commands, access other servers, create a new spid...

    Yes, basically this Store Proc call to another procedure that import...

  • RE: Restore fails

    Hey

    Now i got this error

    Msg 3201, Level 16, State 1, Line 1

    Cannot open backup device '\\10.9.2.109\stars\ABC\STARS_backup_2012_11_19_173006_6820968.bak'. Operating system error 5(Access is denied.).

    Msg 3013, Level 16, State 1, Line 1

    BACKUP DATABASE...

  • RE: Restore fails

    Lowell (11/19/2012)


    yeah the error implies either the file or folder is spelled incorrectly, or the filename itself doesn't exist...extra underscore or anything like that a possibility in the name?

    i check...

  • RE: Pivoting Help

    Eugene Elutin (11/13/2012)


    BTW. Formatting your query nice, improves its readability and therefore its maintainability:

    SELECT vcEmployeeUniqueID

    ,vcLastName

    ...

  • RE: Pivoting Help

    Eugene Elutin (11/13/2012)


    Looks like homework to me.

    Have you tried using PIVOT. Where are you so far?

    We can help you to learn and resolve issues instead of just providing...

Viewing 15 posts - 46 through 60 (of 80 total)