Forum Replies Created

Viewing 15 posts - 451 through 465 (of 1,217 total)

  • RE: Format Query Value

    It is pretty nasty thing to do it on SQL Server, but if it is really necessary, here you go:

    DECLARE @value INT

    SET @value = 1234567

    SELECT  @value as orig_value,

     CONVERT(VARCHAR(20), CONVERT(money,@value),1)...

  • RE: IN with Parameter

    Hi,

    lots of info, explanations, tests of performance and various solutions can be found at Erland Sommarskog's pages

    You will find several articles there that apply to your situation, especially

  • RE: LEFT OUTER JOIN HELL!!

    If you don't have Numbers and Dates tables yet, you can create them now.

    CREATE TABLE Numbers

    ( Number INT NOT NULL,

     CONSTRAINT PK_Numbers

      PRIMARY KEY CLUSTERED (Number)

      WITH FILLFACTOR = 100)

    INSERT INTO Numbers

    SELECT (a.Number *...

  • RE: Insert statement

    Hi,

    the column list in INSERT INTO needs to be in parentheses, and it has to be followed by SELECT (or VALUES).

    If you want to skip certain column (not insert anything...

  • RE: Trigger - Capture Field Changed

    The linked article shows some useful info, but I'm not sure it applies to you. That depends on what you consider as "UPDATE".

    For the sake of IF UPDATE(column) and...

  • RE: query

    Hmmm... I'm not sure I follow you.

    First, you did not mention datatypes of the columns, primary keys and other useful info about data contained in them. Second, you did not describe relations...

  • RE: data conversion Error in update query

    I agree, most probably the problem is caused by missing quotes (although without DLL it is just a guess - but both posted tables use CHAR on all columns):

    and (rptPXA2.DCode)...

  • RE: Consecutive spaces in 1 field

    Well, I already posted that above, Arthur... If the only column of a view is defined like this:

    SELECT doctype+

    LEFT(ISNULL(docname,'')+space(25),25)+space(3)+

    LEFT(ISNULL(phone,'')+space(18),18) +

    LEFT(ISNULL(deanumber,'')+space(9),9)+CHAR(13)+CHAR(10)+

    LEFT(ISNULL(statelicense,'')+space(15),15)+

    LEFT(ISNULL(street,'')+space(30),30) as myexp

    FROM #export

    then export into fixed length text file...

  • RE: Dynamic Query output into Cursor

    In 99% of cases, cursor is not necessary. If you need to store the result, better do it in a table (permanent or temporary) or table variable. Make the INSERT...

  • RE: LEFT JOIN question

    If you want to return only one row for each row in table A, then you have to decide what should happen to the rest of data selected with the...

  • RE: CASE WHEN

    If I would need to write such CASE for some reason, I would prefer not to use LIKE (that only makes sense if you are searching for a pattern, i.e. part...

  • RE: criteria to use iindex

    Hello Karthikeyan,

    These forums are here to help those who work with SQLS and encounter some problem with which they need assistance. Your questions show that you don't know anything about SQL Server...

  • RE: Consecutive spaces in 1 field

    I still don't understand why you need to create several views (you can export 2 lines of text from 1 row of a view), but if you are happy with this...

  • RE: insert statement

    Create composite unique index on columns A,B,C (not necessarily in this order - use the most selective column as first).

    When inserting, check whether a row with the same values exists or not....

  • RE: what are causes for slow insert operations in table ?

    Is this a plain insert that you are talking about, or does it contain lots of joins and/or a where clause? It could also be that it isn't the insert...

Viewing 15 posts - 451 through 465 (of 1,217 total)