Forum Replies Created

Viewing 15 posts - 136 through 150 (of 238 total)

  • RE: First Join on TempTable takes 1 second

    It might be the way the query is compuiled inside your SP. If number of rows in the perm table is small, then indexes do not matter anyway. You may...

  • RE: SQL Cursor vs. ActiveX Script Task?

    UPDATE Xaction

    SET FaxReqPhoneNum = CASE when x.FaxReqPhoneNum = 0 then v.FaxReqPhoneNum

    END

    , InternationalPhoneFlag = CASE when x.InternationalPhoneFlag = 0 then v.InternationalPhoneFlag

    END

    FROM XactionVRU v

    JOIN Xaction x

    ON v.SSNum = x.SSNum

    AND...

  • RE: Block the DBA?

    Ladies and Gentlemen,

    Please do not be so serious. This article is entertaining - that's it. If a junior (or "SENIOR") DBA should take it seriously, the worst thing that could...

  • RE: Hanging Transaction

    If you are calling one procedure from another, make sure you handle transactions properly in both procedures. Do not nest transactions; do this:

    SET @local_transaction = 0

    IF @@TRANCOUNT = 0

    BEGIN

    ...

  • RE: SQL Cursor vs. ActiveX Script Task?

    My rule is never use cursors.

    Well, there are rear exclusions but this is not the one. It is healthier for your production environments to forget completely cursors ever existed.

    I...

  • RE: SQL Cursor vs. ActiveX Script Task?

    My suggestion is NOT to use cursor nor an ActiveX.

    First, load your data into a load table from the file.

    Second, run a scrubbing SP that would bring your...

  • RE: Datatype for Huge amounts of Text

    Use code to insert text data into your table. Do not use Enterprise Manager.

    Do not use regular SQL INSERT, UPDATE, etc. The following commands should be used:

    READTEXT, TEXTPTR, WRITETEXT,...

  • RE: Increment Field Dynamically on Insert

    I would not recommend creating a column and dropping it dynamically. There is no elegant solution to this request. You could maintain the last used number in something like tbl_system_parameter...

  • RE: Hanging Transaction

    Do you have a proper error handling inside SP? Do you check IF @@ERROR <> 0 after each SQL statement and then GOTO error_handler? Did you put IF @@TRANCOUNT >...

  • RE: Scripting SQL Functions

    I doubt there is a way. However, if you execute the whole script couple times in a row, it should run with no errors the second time (unless you drop...

  • RE: Table/Column Naming Conventions (Opinions Wanted)

    I understand the points about OOP made in the previous message. In the same time, SQL language itself does not support OOP.

    A column named ID will be used without...

  • RE: This View has the Flu

    In fact using a user-defined function that returns a table is a very good alternative to a view because it replaces functionality of a parameterized view not supported by SQL...

  • RE: Is this good sql?

    I think the result may depend on how you will be using the view. If it is a part of a query that is not very trivial, I would not...

  • RE: Table/Column Naming Conventions (Opinions Wanted)

    I always use singles, not plurals, for table names: tbl_employee, tbl_employee_history.

    I would not recomment naming column as just Id. First of all, it is a reserved word (it changes color...

  • RE: Select that always returns one value

    Just change your sample query to the following:

    SELECT Column1 FROM Table1 WHERE Column2 IN

    (SELECT Column2 FROM Table2 WHERE Column3=@Value1

    UNION SELECT 'mystaticitem'

    )

    AND Colum4=@Value2

Viewing 15 posts - 136 through 150 (of 238 total)