Forum Replies Created

Viewing 15 posts - 12,511 through 12,525 (of 15,381 total)

  • RE: SET BASED UPDATE Statement

    Well sort of...but your order by column is not unique so which value of 'A' is first? This makes it rather challenging.

    this is close...

    IF OBJECT_ID('tempdb..#GETID') IS NOT NULL drop table...

  • RE: Design Question, Tracking input changes by users

    Well since it is public facing Windows Authentication is not going to work. You could add a SysModUID column or something along those lines to each table, make it not...

  • RE: SET BASED UPDATE Statement

    It is kind of hard to determine exactly what you are trying to do. You say Previous row but a table does not know anything about order. You need to...

  • RE: split date range to individual dates

    Something like this:

    declare @StartDate datetime = '2/1/2012'

    declare @EndDate datetime = '2/3/2012'

    select ROW_NUMBER() over(order by t.N), dateadd(d, t.N - 1, @StartDate)

    from Tally t

    where N <= datediff(d, @StartDate, @EndDate) + 1

  • RE: split date range to individual dates

    You should be able to combine datediff, dateadd and a tally table to get what you are looking for. Read Jeff's article about what a tally table is and how...

  • RE: How to convert this XML into columns

    I have to agree with Lynn. How about we take this approach, you go dig through the 100+ posts of mostly nonsense and find the ddl and sample data in...

  • RE: Design Question, Tracking input changes by users

    Take a look at CDC (Change Data Capture).

  • RE: Tell me the solution Please

    As Lutz already said, if you want some real help you will need to provide some real information (ddl, sample data etc)...

    Taking a shot in the dark it looks like...

  • RE: Question on Pitvoting data in SQL

    Jeff Moden (4/9/2012)


    Sean Lange (4/5/2012)


    Unless the product list is going to exceed 8,000 characters there is no need to use CLR for this. The code I provided is a delimited...

  • RE: Trigger to capture data before and after an update

    I may be a little late on this one but I would suggest you use @@servername instead of db_name(). This has bitten me a couple times in the past. You...

  • RE: How to convert this XML into columns

    Lynn Pettis (4/6/2012)


    Sean Lange (4/6/2012)


    So given the error message what do YOU think the problem is? This is not some voodoo uber awesome sql thing hidden away. It should take...

  • RE: How to convert this XML into columns

    So given the error message what do YOU think the problem is? This is not some voodoo uber awesome sql thing hidden away. It should take anybody with basic sql...

  • RE: Foreign key

    sknox (4/6/2012)


    Sean Lange (4/6/2012)


    ... Basically you can simulate a foreign key via triggers but it is NOT actually a foreign key.

    NO.

    Any column in a table is a foreign key column...

  • RE: How to convert this XML into columns

    That won't run. There is a where clause stuck in there that I can't figure out what you are trying to with.

  • RE: Foreign key

    Jack Corbett (4/6/2012)


    Sean Lange (4/6/2012)


    Hugo Kornelis (4/6/2012)


    Sean Lange (4/6/2012)


    Basically you can simulate a foreign key via triggers but it is NOT actually a foreign key. In that case...

Viewing 15 posts - 12,511 through 12,525 (of 15,381 total)