Forum Replies Created

Viewing 15 posts - 196 through 210 (of 463 total)

  • RE: Using Cursors Inside Stored procedure problem

    Syntactical!

    if @TransCode='TR001'

    BEGIN

    SET @p1 = dbo.AddFltAmount(@p1,@Flt_Amount) --here where i am getting error

    END

    ....and dont put end if!

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

  • RE: Search Query

    'Catch all' ,follow the link

    http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/

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

  • RE: Top 2 records

    Bru Medishetty (11/16/2009)


    Use This

    SELECT TOP 2 AppName, Date, Query FROM YOUR_TABLE

    GROUP BY AppName, Date, Query

    This would just give 2 records from the entire result set, no? I thought OP wanted...

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

  • RE: String to automatic backup in a job

    + replace(str(datepart(hour,@tToday),2,0,),N'',N'0')

    There is a comma after 0 and before parenthesis. By the way shouldnt u be writing dynamic sql at the end?

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

  • RE: DATEDIFF

    Explanation and test data are completely unclear!! but still tried my best.

    It works just fine with this when I retrieve the data after update. What is the problem.

    drop...

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

  • RE: query to filter top 10 values?

    Reluctantly I am posting this as I am sure there IS a better way of doing it. But I could not think of any other thing apart from this now,...

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

  • RE: Confusion in transaction

    Just to add to what Lynn has mentioned,

    its a variable stored in memory for our operations, where would it 'commit/rollback' it to (no table or anything to go back...

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

  • RE: Mixed caps

    This is called 'Title' case I guess. I dont think we have any built in functions in ss2k5 ( not sure about ss2k8). You might need to write an UDF...

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

  • RE: Logins from 2000 to 2005

    I guess you have to create the server logins explicitly on 2005 (once you move your db). Users would be there at database level.

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

  • RE: problem with dll in clr project

    Not sure what you are trying to do, but to use the external dll, cant you just add it as 'reference' and then use it?

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

  • RE: create stmts generated dynamically and execute them on specific database

    hmm.. along with your script include 'USE db2 GO' in your dynamic SQL and use sp_executesql to execute it.

    http://msdn.microsoft.com/en-us/library/ms188001(SQL.90).aspx

    BTW, as Doug.Williams mentions, you can use the fully qualified name...

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

  • RE: I have few sqlzoo query command questions

    Good site as J-F Bergeron mentioned 🙂

    There is no point if we help you out and you wont learn. Can give hints as in for 2a its one of...

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

  • RE: sessionID and query

    Magy (11/12/2009)


    Oh ok,

    Well each table will have a sessionID column that identifies which session the data belongs to.

    A table row cannot exist without a sessionID entry.

    So maybe...

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

  • RE: Check to drop temp table.

    u r welcome 🙂

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

  • RE: Check to drop temp table.

    Is this what you want at the top of your stored procedure?

    IF OBJECT_ID( 'tempdb..#urtemptable') IS NOT NULL

    DROP TABLE #urtemptable

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

Viewing 15 posts - 196 through 210 (of 463 total)