Forum Replies Created

Viewing 15 posts - 4,831 through 4,845 (of 6,036 total)

  • RE: UDF does not work in SELECT statement

    And?

    If the word 'QUOTATION' is not found, then @Counter = ?

    Check your calculations.

    Another issue - CHARINDEX does not work with TEXT. It implicitly converts it into VARCHAR(8000).

    Continue?

  • RE: TRIGGER QUESTION

    You may join tables inserted and deleted :

    FROM inserted i

    INNER JOIN deleted d ON i.MemberNbr = d.MemberNbr and (i.Status1 <> d.Status1 OR i.Status2 <> d.Status2 )

     

  • RE: UDF does not work in SELECT statement

    And your function is quite bad.

    I definitely would not use it.

    For  example:

      SET @Counter = CHARINDEX('QUOTATION', @UserText) + 16

      IF @Counter > 0

    ...

    Can you provide an example when @Counter gonna be  <=...

  • RE: UDF does not work in SELECT statement

    Set in QA "Results to Text" and copy-paste from there.

  • RE: UDF does not work in SELECT statement

    Run this:

    SELECT JobNumber, UserText, MFJBS.dbo.GetQuoteNumberFromUserText(UserText) FROM JobMaster WHERE JobNumber = '06D3104'

    and see what exactly you function does not handle.

    Your UserText must not be the same as the test...

  • RE: Join question

    It's better if next time you'll ask what you actually need from the beginning.

    Just not to waste everybody's time.

    INSERT INTO dbo.Table1 (Col1, Col2, Col3)

    SELECT Col1, Col2, Col3

    FROM Server2.DB2.dbo.View2 b

    WHERE NOT...

  • RE: Extract text

    It's a problem of those developers.

    Let them read the text as they saved it and do with it whatever they want in their application.

    Database is DATA-BASE.

    It's for saving data,...

  • RE: Extract text

    What makes you think that T-SQL is the best tool to read HTML?

  • RE: Syntax error converting datetime from character string.

    There is no datatype "varchar"

    DECLARE @START_DATE varchar,@END_DATE varchar

    actually means

    DECLARE @START_DATE varchar(1) ,@END_DATE varchar(1)

    And it's not so easy to understand why you declare date variables as varchar, not...

  • RE: Getting CPU and I/0 usage from several Sql Servers

    exec ServerName.master.dbo.sp_monitor

  • RE: Table Column as Variable

    You probably need to read BOL about temporary tables.

    Where and when they are created, when dropped, what is the scope for it, etc.

  • RE: Another Date Difference Question

    Join table yo itself on

    T1.AdmissionDate > T2.AdmissionDate AND T1.AdmissionDate <= T2.AdmissionDate + 30

    And select what you need from T1.

    T1 and T2 are aliases for the same table.

  • RE: @@rowcount assignment

    @@rowcount returns number of rows affected by LAST statement.

    Any questions?

  • RE: Best Way For Primary Key

    It's better to use

    CREATE VIEW dbo.journal

    SELECT CompID, FYr, JID, Max(TrnNo) as LastNoH

    FROM TrHead

    GROUP BY CompID, FYr, JID

    That's it.

    You may create index on this view to make it...

  • RE: Best Way For Primary Key

    1. Don't use cursors. DO everyting in a single set based statement

    2. Set up indexes.

    3. If you do corelated INSERT/UPDATE on more than 1 table use transactions

    But actually the wole...

Viewing 15 posts - 4,831 through 4,845 (of 6,036 total)