Forum Replies Created

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

  • RE: Dynamic query problem

    aren't you equating varchar to float in the dynamic query ?

    Is data conversion the actual error ?

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • RE: MERGE STATMENT Error :Cannot Contain multi-part identifiers.

    Remove TGT. from Merge statement inside when matched.

    Thanks

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • RE: NULLs IN ROW_NUMBER ( ) OVER OVER' Partition By list

    2) place them into a temporary table and rank them using the code a fragment of which i posted,

    3) insert into base table all the records with rank (rNum)=1

    My only...

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • RE: NULLs IN ROW_NUMBER ( ) OVER OVER' Partition By list

    Velkry Was it helpful ?

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • RE: Try catch in a transaction block or transaction in try catch block???

    CREATE PROCEDURE EXAMPLE (@parameter)

    ---- To illustrate how I intend to Use Execption Handling inside my Cursor

    AS

    BEGIN

    BEGIN TRY

    DECLARE @TABLENAME VARCHAR (10)

    DECLARE DROPTABLE CURSOR

    FOR SELECT NAME...

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • RE: Deleting multiple tables with information schema

    derekr 43208 (10/12/2011)


    That should do it

    Remember though, this is predicated on the fact that you have no constraints on the tables you want to delete. Foreign Keys etc...

    Exactly , in...

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • RE: Try catch in a transaction block or transaction in try catch block???

    SQL_By_Chance (10/12/2011)


    What do you mean "error on cursor"? An error that occurs within the loop? Nested transactions?

    Expand a bit and I'll try to help.

    Yeah the dynamic sql that is generated...

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • RE: Try catch in a transaction block or transaction in try catch block???

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • RE: Question about rows vs. columns

    I don't think this will help here since both rows need to be merged (to combine the IND the first one and OUTD of the second one)

    I would merge each...

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • RE: Try catch in a transaction block or transaction in try catch block???

    Gianluca Sartori (9/23/2011)


    You can use my stored procedure code template[/url] if you like it.

    It should do what you ask for.

    Regards

    Gianluca

    Gina, Can you please post me a Template for handling...

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • RE: Deleting multiple tables with information schema

    DECLARE @TABLENAME VARCHAR (10)

    DECLARE DROPTABLE CURSOR

    FOR SELECT NAME FROM INFORMATION_SCHEMA.TABLES -- OR SYSTABLES

    WHERE NAME LIKE '%SHI%'

    OPEN DROP TABLE

    FETCH NEXT FROM DROPTABLE

    INTO @TABLENAME

    WHILE (@@FETCH_STATUS...

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • RE: Question about rows vs. columns

    Try using CTE with ROW_NUMBER() . Delete from CTE where rowNUM > 1

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • RE: Resetting the identity increments

    am-244616 (10/11/2011)


    Guys,

    I am trying to setup merge replication between two 600 table database, is there a generic script to reset the identity increment on one database to have even numbers...

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • RE: Implement 'USE' + @DB inside procedure

    Gianluca's solution would work just as well.

    Thanks CheeseHead.Completely Agree. 🙂

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

  • RE: Implement 'USE' + @DB inside procedure

    Thanks Gianluca,

    Does this mean : [tempdb.sp_executsql @sql ] would get executed in Temp DB ?

    ______________________________________________________________________

    Ankit
    MCITP Database developer SQL 2008,MCTS Database Administration SQL 2008
    "Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose.
    You are already naked. There is no reason not to follow your heart.”

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