Forum Replies Created

Viewing 15 posts - 361 through 375 (of 1,048 total)

  • RE: Stupid Question: Return Object Explorer to It's original position

    You can't say this as a stupid qurstion, may be there are many other users who faced this type of problem and didn't find a solution for this.....

    Main thing is...

  • RE: SP Date parameter default to GETDATE()?

    OTF (7/18/2013)


    kapil_kk (7/18/2013)


    Instead of specifying it in parameter list you can assign GETDATE() to local variable inside stored procedure body:

    CREATE PROCEDURE sp_MyProcedure

    @Record_ID Varchar(12),

    @OtherKey_ID Int,

    @Comments VARCHAR(MAX) = NULL

    AS

    BEGIN

    DECLARE @DateParameter...

  • RE: check if index exists

    You can use below queries to find the index present on a specific table:

    sp_helpindex 'table_name'

    OR

    select i.name, i.type_desc

    from sys.indexes I

    join sys.tables o ON i.object_id = o.object_id

    WHERE o.name = 'table_name'

  • RE: SPs inside BEGIN/ROLLBACK TRAN

    It will be better if you used Transaction in your stored procedure itself.......

  • RE: SP Date parameter default to GETDATE()?

    kapil_kk (7/18/2013)


    Instead of specifying it in parameter list you can assign GETDATE() to local variable inside stored procedure body:

    CREATE PROCEDURE sp_MyProcedure

    @Record_ID Varchar(12),

    @OtherKey_ID Int,

    @Comments VARCHAR(MAX) = NULL

    AS

    BEGIN

    DECLARE @DateParameter DATE...

  • RE: SP Date parameter default to GETDATE()?

    Instead of specifying it in parameter list you can assign GETDATE() to local variable inside stored procedure body:

    CREATE PROCEDURE sp_MyProcedure

    @Record_ID Varchar(12),

    @OtherKey_ID Int,

    @Comments VARCHAR(MAX) = NULL

    AS

    BEGIN

    DECLARE @DateParameter DATE

    SET...

  • RE: delete top 100

    ChrisM@Work (7/18/2013)


    kapil_kk (7/18/2013)


    If you specify alias with TOP in delete it will always gives you an error:

    e.g.

    DELETE TOP (2)

    FROM tbl1 t

    Your syntax is incorrect:

    DELETE TOP (2) t

    FROM tbl1 t

    delete...

  • RE: delete top 100

    If you specify alias with TOP in delete it will always gives you an error:

    e.g.

    DELETE TOP (2)

    FROM tbl1 t

  • RE: Need help with Select Where clause using parameter equal blank or in a list

    Can you please some sample data that you are trying to insert?

  • RE: error

    Voide (7/17/2013)


    kapil_kk (7/17/2013)


    Voide (7/16/2013)


    riya_dave (7/16/2013)


    hi

    select * from tableA with(nolock) a

    join tableB with(nolock) b

    on a.id = b.id

    where a.date > getdate()

    i am getting error incorrect syntax near a

    As Gail said, why nolocks?...

  • RE: Return

    Thanks Tom for the explanation.......

  • RE: Select All Records from Temporary Table and Assign to VARCHAR?

    can you please provide some sample data with resultant output.......

  • RE: Return

    Carlo Romagnano (7/17/2013)


    kapil_kk (7/16/2013)


    Hi,

    as per the explanation- The stmt "return (select 5)" gives error because in a batch RETURN with integer_expression is not admitted (note: PARENTHESIS cast the SELECT to...

  • RE: Return

    DevilsChest (7/17/2013)


    kapil_kk (7/16/2013)


    But we use integer expression with RETURN in a stored procedure and it works...

    I am confused that will integer expression works only in stored procedure and not in...

  • RE: error

    GilaMonster (7/16/2013)


    Or you could just remove the nolock hints entirely and remove any chance of their nasty side effects causing you problems.

    See - http://blogs.msdn.com/b/davidlean/archive/2009/04/06/sql-server-nolock-hint-other-poor-ideas.aspx

    Gail,

    Can you please tell me that when...

Viewing 15 posts - 361 through 375 (of 1,048 total)