Forum Replies Created

Viewing 15 posts - 1,531 through 1,545 (of 5,502 total)

  • RE: How to compare multiple rows of one table with multiple rows of another table

    Oh, now I see what you're looking for...

    Maybe the following code will do the trick:

    ;WITH cte AS

    (SELECT ROW_NUMBER() OVER(PARTITION BY t1.ActivityControllerID ORDER BY t1.ActivityID) row

    FROM @tbl2...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: treat nulls in count function?

    Try to google or search this site for the difference between COUNT(*) and COUNT(column_name).



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)

    It's worth to notice that laddu4700 already posted his question in a different thread.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: delete rows

    Based on the code in the sproc you posted:

    This is designed to do the same sort of thing as Access's cascade delete function.

    Why don't you add a (referential) foreign key...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: issues in inserting data(no constraint supplied)

    since SQL Server doesn't know if you'd like insert the value into the ID or name column, you need to specify it:

    insert into ID1(ID) values(8)

    And no, SQL Server will not...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: delete rows

    Why don't you use referential integrity together with cascaded delete?



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: issues in inserting data(no constraint supplied)

    Either you provide a value for each column or you need to identify the column(s) you'd like to insert the values.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: how to export data in sql server?

    There are numerous tools available to import data such as SSMS, BULK INSERT, OPENROWSET, linked server, SSIS, BCP.

    Each one has its own strngth and weaknesses.

    Question aside: is this a real-world...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: how to alter column to add identity>??

    One option to add the identity property would be using SSMS (right-click on the table -> design).

    "Under the hood" it creates a new table, insert the original data, drop the...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: How to track old values

    In SS2K5 you could use a trigger and insert the the data of the internal tables INSERTED and DELETED into an audit table.

    Your view would be based on the 10...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: How to compare multiple rows of one table with multiple rows of another table

    Here's a short example using LEFT JOIN:

    DECLARE @tbl TABLE

    (

    ID INT IDENTITY (1,1),

    ActivityControllerID INT,

    ActivityID INT

    )

    INSERT INTO @tbl

    VALUES(4,2),

    (4,4),

    (4,5),

    (4,6),

    (8,1),

    (8,3),

    (8,4),

    (8,5),

    (8,6),

    (8,7)

    DECLARE @tbl2 TABLE

    (

    ActivityControllerID INT,

    ...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Sequentially processing messages in Service Broker Queue

    You could check if your Activation Stored proc is running before processing the next message.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: blocking due to long query, insert, and new queries

    Try to eliminate the root cause (= the duration of the "long running query"). It might be an option to use the Divide'n'Conquer concept if this is a really complicated...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Getting @@RowCount in select statement doesn't work in Proc

    What exactly are you trying to achieve?



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: How to compare multiple rows of one table with multiple rows of another table

    You could use NOT EXISTS or a LEFT OUTER JOIN.

    The requirement itself is a little unclear since you mention a AcitivityControllerID column that is not part of the result set...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 15 posts - 1,531 through 1,545 (of 5,502 total)