Forum Replies Created

Viewing 15 posts - 4,756 through 4,770 (of 6,036 total)

  • RE: Dynamic SQL - Drop Table

    Before you start the argument you better learn the matter. Then you not gonna ask all those questions.

    SQL Server anyway will check for all kinds of objects created or declared...

    _____________
    Code for TallyGenerator

  • RE: Shortest Path Algorithm

    As I can see the question was not about travel time, but about distance.

    Not even about travel distance, just distance.

    I doon't think distance could depend on measuring direction. Unless you...

    _____________
    Code for TallyGenerator

  • RE: Create triggers on all tables

    exec sp_msforeachtable

    'if dbo.checkforcolumn(''?'',''columnname'')=''exists''

    begin

    exec (''create trigger foo on ?

    for insert, update

    as

    do stuff'')

    end'

    _____________
    Code for TallyGenerator

  • RE: Dynamic SQL - Drop Table

    Here we are.

    "Drop all instanciated objects application side" - agree. But #Tables are not "application side", right?

    They are not even part of the database you are connected to. It's Server...

    _____________
    Code for TallyGenerator

  • RE: Dynamic SQL - Drop Table

    Yes, it would be nice to have a single standard for all tables, so how you use to drop table variables?

    Do you actually follow your rule "any instanciated object should...

    _____________
    Code for TallyGenerator

  • RE: Shortest Path Algorithm

    SELECT T1.StoreID, T2.StoreID, CAST(NULL as real) as Distance

    INTO dbo.Roads

    FROM dbo.Stores T1

    INNER JOIN dbo.Stores T2 ON T2.StoreID > T1.StoreID

    Because distanse from Store2 to Store5 = distanse from Store5 to Store2 and distanse...

    _____________
    Code for TallyGenerator

  • RE: Create triggers on all tables

    From BOL:

    "CREATE TRIGGER must be the first statement in the batch and can apply to only one table."

     

    _____________
    Code for TallyGenerator

  • RE: SQL syntax

    Lynn, the challenge was about solution.

    Edwin's solution was bad for 3 reasons:

    1) failing provide correct SQL syntax when that was actually the only point of the topic;

    2) using function in...

    _____________
    Code for TallyGenerator

  • RE: Dynamic SQL - Drop Table

    Out of curiosity - how do you "undeclare" declared objects, variables (including tables) if you cannot rely on the system to clean up after you?

    _____________
    Code for TallyGenerator

  • RE: Dynamic SQL - Drop Table

    You may rely on SQL on this.

    As soon as it comes to MyCn.Close you may be sure the table is dropped.

    Just don't forget to close connections.

    _____________
    Code for TallyGenerator

  • RE: T-SQL Help

    declare @Ordered datetime, @Delivered datetime

    select @Ordered = GETDATE(), @Delivered = GETDATE() + 2.7

    select datediff(hh, @Ordered, @Delivered) - DATEDIFF(wk, @Ordered, @Delivered)*48

     DATEDIFF(wk, ...) returns number of weekends between dates. Does not depend...

    _____________
    Code for TallyGenerator

  • RE: Error in my stored procedure

    As soon as @l_strRetVal is VARCHAR (8000) you must use CONVERT(VARCHAR (8000), ...) for all fields having type text and participating in population of this value.

    And read again Joh's post....

    _____________
    Code for TallyGenerator

  • RE: Dynamic SQL - Drop Table

    Yes, #temp table is available for nested sprocs.

    Create PROC dbo.Bunch

    AS

    CREATE TABLE #temp (...)

    exec dbo.Step1

    exec...

    _____________
    Code for TallyGenerator

  • RE: COALESCE in the setting relationships

    Actually I don't see any point of this replacement.

    COALESCE (CUSTORDER.COMPANY , CUSTORDER.COMPANY)  = CUSTORDER.COMPANY

    all the time.

    This makes query only slower.

    Probably he ment this:

    INNER JOIN LAW_PROD.dbo.CUSTORDER CUSTORDER

    ON SAINVOICE.COMPANY = COALESCE...

    _____________
    Code for TallyGenerator

  • RE: Speeding up a huge delete

    Actually it's safe to run around o'clock. That's what those 1sec pauses are about.

    You may start performance monitor and than run the code. See if it have added any significant...

    _____________
    Code for TallyGenerator

Viewing 15 posts - 4,756 through 4,770 (of 6,036 total)