Forum Replies Created

Viewing 15 posts - 91 through 105 (of 362 total)

  • RE: Stored Procedure

    [font="Verdana"]Then what you need to do is, to use the Table variable example which Grant has suggested.

    Mahesh[/font]

  • RE: Stored Procedure

    [font="Verdana"]

    Grant Fritchey (2/5/2009)


    The last post is close...

    Grant i didn't get you.

    Mahesh

    [/font]

  • RE: Stored Procedure

    [font="Verdana"]something like:

    Create Table Tab1

    (IdInt Identity(1,1),

    NameVarChar(10))

    Go

    Create Table Tab2

    (IdInt,

    NameVarChar(10))

    Go

    -- Insert

    Insert IntoTab1 (Name)

    Output Inserted.Id, Inserted.Name Into Tab2(Id, Name)

    Values ('AAAA')

    Insert IntoTab1 (Name)

    Output Inserted.Id, Inserted.Name Into Tab2(Id, Name)

    Values ('BBBB')

    Go

    Select * From Tab1

    Select...

  • RE: TRY -CATCH block with user defined errors

    [font="Verdana"]What if you will handle FALSE in Else part? Why you need this situation to be handle in Catch part?

    Mahesh[/font]

  • RE: Select n-tier hierarchy from one table

    [font="Verdana"]Let us know, what problem still your are facing. What stange situation you have and three of the examples are not working for you.

    Thats why I have asked you...

  • RE: Select n-tier hierarchy from one table

    [font="Verdana"]Let us know some sample data with expected o/p. Even the example I have given you earlier, go into its details. It is self explanatory. Anyways let us know your...

  • RE: Select n-tier hierarchy from one table

    [font="Verdana"] Let us know...

    Create Table dbo.Employee(

    EmpIdInt

    ,EmpNameVarChar(10)

    ,MgrIdInt)

    Go

    Insert Into Employee

    Select1, 'AAAA', 2 Union All

    Select2, 'BBBB', 3 Union All

    Select3, 'CCCC', 4 Union All

    Select4, 'DDDD', 1 Union All

    Select5, 'EEEE', 2

    Go

    SelectE.EmpId, E.EmpName, E.MgrId, M.EmpName

    FromEmployee As...

  • RE: stored procedure with optional parameters

    [font="Verdana"]Parameters in SProcs are not optional. You have to mentioend them while calling the SProc. You can instead mention 'DEFAULT' keyword while passing the parameters. Like:

    EXEC dbo.sp_Sample Default, Default

    Mahesh[/font]

  • RE: Sql Query Help

    [font="Verdana"]even almost same discussion can be found at http://www.sqlservercentral.com/Forums/Topic646567-145-1.aspxBut I think Jeff's article is much better explanatory.

    Mahesh[/font]

  • RE: How to display data in separate cell!

    [font="Verdana"]I din't get your requirement. But I think you are looking for PIVOT. For more information, check out BOL

    Mahesh[/font]

  • RE: how to select data from a office directory table

    [font="Verdana"]Almost similar post. Please view http://www.sqlservercentral.com/Forums/Topic646567-145-1.aspx

    Mahesh[/font]

  • RE: Execute procedur ethrough trigger

    [font="Verdana"]Yes, It can be done through executing the SProc inside Trigger as well. However I am not aware with the Pros and cons of it.

    If anybody is aware with it,...

  • RE: Tranpose Table Data into .txt file

    [font="Verdana"]I think you better write a UDF like:

    Create Function dbo.Convert_Into_CSV(@ID Int)

    Returns VarChar(50)

    As

    Begin

    Declare@CSVVarChar(50)

    Select@CSV = Case When @CSV Is Null Then col2 Else @CSV + ', ' + col2 End

    FromTest

    Wherecol1...

  • RE: Execute procedur ethrough trigger

    [font="Verdana"]Then why you need the SProc for this. Just directly write whatever the statements you wants to wtire inside SProc. You can write such statements under IF UPDATE(column_name) condition. It...

  • RE: XQuery Problem

    [font="Verdana"]Thank you very much noel, it works.

    Mahesh[/font]

Viewing 15 posts - 91 through 105 (of 362 total)