Forum Replies Created

Viewing 15 posts - 7,996 through 8,010 (of 15,381 total)

  • RE: How to generate Sequence numbers in a temporary table?

    Glad that worked for you.

  • RE: SSRS Report times out

    Paresh Motiwala (6/11/2013)


    I have a report that ran fine prior to upgrade to sql 2008 R2 SP1.

    It has 3 parameters.

    1. to select people,

    2. to select date.

    3. is default(run date)

    when...

  • RE: inline table function

    sqlfriends (6/11/2013)


    Thanks, the two answers is just what I want.

    One more question, so for join inline table function we should always use cross apply, is that correct?

    You should read this...

  • RE: ErrorMessage as Output parameter of a stored procedure

    So just like the example for BOL.

    CREATE PROCEDURE [dbo].[pr_insertAgencyVendorInfo]

    ( @ClientName nvarchar(15),

    @VendorName nvarchar(40),

    @TaxID nchar(9),

    @ActiveFrom datetime,

    @ActiveTo datetime,

    @ErrorMsg nvarchar(4000) OUTPUT)

    as

    begin try

    insert into AgencySupplierPartner

    (ClientName,VendorName,TaxID,ActiveFrom,ActiveTo)

    VALUES

    (@ClientName,@VendorName,@TaxID,@ActiveFrom,@ActiveTo)

    end try

    begin catch

    SELECT @ErrorMsg = ERROR_MESSAGE()

    end catch

    The only difference here is...

  • RE: inline table function

    Something like this should work. This is untested because there is no sample data.

    CREATE FUNCTION [dbo].[GetStreetApt] ( @StudentID INT )

    RETURNS TABLE

    RETURN SELECT CAST(ama.houseNumber AS...

  • RE: How to generate Sequence numbers in a temporary table?

    You should read up on how windowed functions work. You have PARTITION BY in your ROW_NUMBER.

    insert #Tmp1

    SELECT ROW_NUMBER() OVER (PARTITION BY ST.ParkingSpaceId ORDER BY StartTime) AS SN,

    When you partition the...

  • RE: Foreign Key Error

    sdhamani1020 (6/11/2013)


    Keep getting this error :

    Error :

    Msg 1776, Level 16, State 0, Line 1

    There are no primary or candidate keys in the referenced table 'tbl_property' that match the referencing column...

  • RE: Cursor Logic causing Blocking ?

    homebrew01 (6/11/2013)


    Nice Reply 😀

    I don't really want to take on anything else right now, but may have to.

    Back to my original question, would you expect that table to be locked...

  • RE: Cursor Logic causing Blocking ?

    Once I see named code blocks and GOTOs all over the place my eyes started bleeding.

    I know that you inherited this so it won't offend you when I say this...

  • RE: ErrorMessage as Output parameter of a stored procedure

    Annee (6/11/2013)


    thanks.. but it's not very helpful.

    If someone can provide an exact sample, would appreciate it!

    Not sure how much more simple it could be than the examples on that page.

    begin...

  • RE: First day of april in a given year

    Lynn Pettis (6/11/2013)


    I also blame this on a lack of caffeine as I am staying away from it until I see my doctor this afternoon.

    I hope everything is ok. Not...

  • RE: First day of april in a given year

    Lynn Pettis (6/11/2013)


    Sean Lange (6/11/2013)


    This should do it.

    declare @MyDate datetime = '2013-03-08'

    --set @MyDate = '2014-08-08'

    set @MyDate = dateadd(month, 3, dateadd(yy, datediff(yy, 0, @MyDate), 0)) --gets April 1st for the current...

  • RE: Cursor Logic causing Blocking ?

    It could be locking especially if there is a transaction outside the loop. From the brief description it sounds like you just make that cursor go the way of the...

  • RE: First day of april in a given year

    This should do it.

    declare @MyDate datetime = '2013-03-08'

    --set @MyDate = '2014-08-08'

    set @MyDate = dateadd(month, 3, dateadd(yy, datediff(yy, 0, @MyDate), 0)) --gets April 1st for the current year.

    select dateadd(wk, datediff(wk, 0,...

  • RE: Variable Kills Performance

    This sounds like parameter sniffing to me.

    http://sqlinthewild.co.za/index.php/2007/11/27/parameter-sniffing/%5B/url%5D

    Make sure you read through all 3 segments of this article.

Viewing 15 posts - 7,996 through 8,010 (of 15,381 total)