Forum Replies Created

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

  • RE: Group multiple Rows into 1 string based on ID field

    I made a couple of small changes and it seems to work with your dataset

    SELECT l2.RegionID,

    STUFF(

    (SELECT ','...

  • RE: Comparing records in one table

    Careful LinksUp, don't depend on the ID column as there is no guarantee that it is the correct order.

    😎

    I had fully intended to use the ChangeDate as ordering,...

  • RE: Comparing records in one table

    Since you posted in a 2008 forum, here is a simple self-join using a cte that gives you your output. If you had access to 2012 or greater you could...

  • RE: Select Distinct and sum

    vfn (10/9/2016)


    HI

    I did follow what you taught me using this code . . .

    but when i try to run it i get

    [Microsoft][ODBC SQL Server Driver][SQL Server]Column 'PupilPersonalDetails.Surname'...

  • RE: Select Distinct and sum

    vfn (10/8/2016)


    i have one more question....

    i have this select . . .

    the above will return this

    Pupil ID Fname Lname Form House...

  • RE: t-sql 2012 cursor

    wendy elizabeth (10/7/2016)


    In a t-sql 2012 listed below, I want the lockids to be set individually from 117173 to 117678. The problem with the sql listed below is all the...

  • RE: Select Distinct and sum

    Please read the link in my signature on how to format and post SQL questions. It will help get better and faster answers.

    So, without any idea about the data or...

  • RE: Updating Table with CTE?

    Sometimes the simplest things trip you up.

    Thanks for the extra set of eyes. With a bit of tweaking, it worked perfectly.

  • RE: Log File is full when reindexing... but not

    Do you backup the log file on any consistent basis?

  • RE: CTE Script Needed for delete statement

    GilaMonster (6/29/2016)


    Just keep in mind that the point of batching isn't necessarily to delete faster, it's to have less impact on other queries (via locks) and less impact on the...

  • RE: CTE Script Needed for delete statement

    Sree Divya (6/29/2016)


    thanks

    can you please share the code

    how to delete by batch wise

    That is something only you can answer. I have no idea what your table looks like and what...

  • RE: CTE Script Needed for delete statement

    GilaMonster (6/29/2016)


    Gah!!!

    My bad. I mis-interpreted what I had read in the docs. It said something along the lines that transactions are logged but that the space used will be...

  • RE: CTE Script Needed for delete statement

    Sree Divya (6/29/2016)


    Hi,

    we are using below script for delete records.but it is taking time

    USE AdventureWorks2008R2;

    GO

    DELETE * FROM Purchasing.PurchaseOrderDetail

    WHERE DueDate = '20020701';

    GO

    is there any possibility of chance to delete the rows...

  • RE: Using joins instead of temp table.

    Glad it worked for you.

  • RE: Using joins instead of temp table.

    This query will work for your test data set. If your real data is different than your sample, then the left join and where clause will have to be tweaked....

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