Forum Replies Created

Viewing 15 posts - 2,956 through 2,970 (of 8,761 total)

  • RE: Stored Procedure using Sql server 2012

    poornima.s_pdi (11/1/2016)


    Hi,

    Thanks for your reply.

    But I am getting the below error while executing the stored procedure.

    Msg 487, Level 16, State 1, Procedure GetTop20MessageByRoomIdOrderByTimeStamp, Line 6

    An invalid option was specified for...

  • RE: Stored Procedure using Sql server 2012

    This procedure returns the top 20 rows, filtered on the RoomID in the descending order of the TimeStamp

    😎

    CREATE PROCEDURE [dbo].[GetTop20MessageByRoomIdOrderByTimeStamp]

    (

    @ROOMID INT

    )

    AS

    SET NOCOUNT ON;

    SELECT

    TOP...

  • RE: Stored Procedure using Sql server 2012

    poornima.s_pdi (10/31/2016)


    Hi ,

    I want to take the data from database based on Id order by timestamp desc and then select first 20 records from the database.

    How to achieve this?In...

  • RE: Speeding Up Delete's on Large Databases

    Jeff Moden (10/31/2016)


    Eirikur Eiriksson (10/31/2016)


    Jeff Moden (10/31/2016)


    Eirikur Eiriksson (10/31/2016)


    Quick suggestion, reading the data to be deleted into a "bucket" variables can drastically speed up the delete, here is an example...

  • RE: Speeding Up Delete's on Large Databases

    Jeff Moden (10/31/2016)


    Eirikur Eiriksson (10/31/2016)


    Quick suggestion, reading the data to be deleted into a "bucket" variables can drastically speed up the delete, here is an example based on the DDL...

  • RE: Speeding Up Delete's on Large Databases

    Quick suggestion, reading the data to be deleted into a "bucket" variables can drastically speed up the delete, here is an example based on the DDL previously posted.

    😎

    DECLARE @id ...

  • RE: SSIS Excel import error

    Quick question, does the "user" have access to the share on the file server?

    😎

  • RE: Group by date fields

    DesNorton (10/31/2016)


    Eirikur's solution groups by PaymentComfirmDate.

    In order to group by Year/Month, you will need to use something like this, which groups by the 1st of every month.

    -- ...

    MonthYear = DATEADD(mm,...

  • RE: Group by date fields

    Here is a quick example that should get you passed this hurdle

    😎

    USE TEEST;

    GO

    SET NOCOUNT ON;

    /* Sample data set */

    ;WITH SAMPLE_DATA(Amount,PaymentComfirmDate,PaymentType) AS

    (

    SELECT

    ...

  • RE: Ports to be open for logshipping for ALWAYSON to stand-alone

    Have a look at this article "AlwaysOn Availability Groups, Listener, Named Instances, Port Numbers, etc.[/url]" from the SQL Server Customer Advisory Team.

    😎

  • RE: Completing Fixed Sets With Another Table

    Not a complete solution but should help you get over this hurdle

    😎

    USE TEEST;

    GO

    SET NOCOUNT ON;

    IF OBJECT_ID(N'tempdb..#Payment') IS NOT NULL DROP TABLE #Payment;

    CREATE TABLE #Payment (

    PaymentId int,

    PersonId int,

    PaymentYear int,...

  • RE: creating a sequence of number starting or each group of ID

    Quick suggestion, do the union in a CTE and apply the row_number outside the CTE

    😎

  • RE: WHAT TO DO WHEN DBCC CHECKDB(REPAIR_ALLOW_DATA_LOSS) FAILS

    Looks FUBAR, questions, how big is the database? what is the latest good backup? what other recovery options are there (manual data entry etc.)? do you have the failed hard...

  • RE: Stop query if it is taking too long

    Jeff Moden (10/24/2016)


    Eirikur Eiriksson (10/24/2016)


    you will need this index on the dbo.Transaction

    CREATE UNIQUE NONCLUSTERED INDEX [INDEX_NAME] ON [dbo].[Transaction]

    (

    [InvoiceUID] ASC,

    [IsSuccess] ASC,

    [TransKind] ASC,

    [TransactionDate] ASC

    )

    INCLUDE ( [CardNumber],[ReferenceNumber],[SeqCounter],[UnqReferenceNumber]);

    I came up with similar but...

  • RE: XML resultset using Query

    SqlStarter (10/29/2016)


    Thanks a lot Eirikur Eiriksson

    You are very welcome.

    😎

Viewing 15 posts - 2,956 through 2,970 (of 8,761 total)