Forum Replies Created

Viewing 15 posts - 931 through 945 (of 1,229 total)

  • RE: Help with Query

    Bob

    Have a look at the output from this:

    CREATE TABLE #Test ([Response ID] INT, Company VARCHAR(15), Amount MONEY, [Quarter] INT, [Year] INT)

    INSERT INTO #Test ([Response ID], Company, Amount, [Quarter], [Year])

    SELECT...

  • RE: Inserting Incremented Alphabets into a column

    kr.nithin (4/19/2011)


    This is a Vendor table. This already has a primary key. The requirement is Alphabets as the unique key rather than the numeric primary key.

    So the numeric "primary...

  • RE: Using SUM renders too many records

    Comment out the joins to the tables apart from bm and bp:

    FROM[VEMA-FACS1].FUELFACS.dbo.bulk_movement AS bm

    INNER JOIN[VEMA-FACS1].FUELFACS.dbo.bulk_product AS bp

    ON bp.bulk_movement_id = bm.bulk_movement_id

    --INNER JOIN[VEMA-FACS1].FUELFACS.dbo.terminal_product AS tp

    --ON tp.terminal_product_number = bp.terminal_product_number

    --INNER JOIN[VEMA-FACS1].FUELFACS.dbo.supplier AS...

  • RE: Inserting Incremented Alphabets into a column

    kr.nithin (4/19/2011)


    Hi,

    I have a table that is already populated. I need to add a new column & the values in the column should be AA, AB, AC, AD, AE,...

  • RE: Subsequent rows compare

    For an update like this, the Running Totals algorithm described here[/url] by Jeff Moden can't be beaten. If you were looking to output the results in the manner you describe...

  • RE: Transaction count error in Stored procedure

    Karan_W (4/19/2011)


    ... If all the statement inside try clause execute successfully then commit the transaction else roll back all transaction...

    How about posting the whole sproc?

  • RE: openrowset - error because of Dot (.) in column name

    marwa.elghali (4/19/2011)


    So, if I understand correctly, even with the use of square brackets around the column names, the dot is still not entirely legal within identifiers and will still pose...

  • RE: openrowset - error because of Dot (.) in column name

    Check out the rules for identifiers in Books Online. Embedding a "dot" in the column name breaks the rules for regular identifiers and forces the use of delimiters. Why not...

  • RE: need help with stored proc passing string for where in (@myparm)

    Put the COLLATE into the SELECT from the #temp table:

    Declare @SaleCategory as varchar(255)

    Set @SaleCategory = 'Outer Wear, Mens, Foot Wear, N/A'

    select Item

    INTO #mytemp

    from [dbo].[DelimitedSplitN4K] (@SaleCategory, ',')

    Select distinct...

  • RE: Limiting a stored procedure

    doug 40899 (4/18/2011)


    I've made further edits to this query and now I'm getting "No o/c listed" as a result when I know that there should be several listings for this...

  • RE: need help with stored proc passing string for where in (@myparm)

    Jeff's posted an updated version of the string splitter here.

    I usually stream the results of a string-splitter into a #temp table then use that in the main query.

  • RE: openquery - stored procedure

    Tom.Thomson (4/18/2011)


    Jeff Moden (4/17/2011)


    Tom.Thomson (4/17/2011)


    Incidentally, you can't call a stored procedure using OPENQUERY either.

    Maybe not, but OPENROWSET works a treat.

    .... Spending too much time on learning Castellano and...

  • RE: Select query that matches data with column names

    parthi-1705 (4/18/2011)


    Lynn Pettis (4/18/2011)


    parthi-1705 (4/18/2011)


    Lynn Pettis (4/18/2011)


    Why all the function calls?

    select

    'id: ' + id + ';' +

    'name: ' + name + ';'...

  • RE: need help with stored proc passing string for where in (@myparm)

    applebutton (4/18/2011)


    I tried this, not working.

    DECLARE @SaleDate datetime;

    SET @SaleDate = GETDATE();

    EXEC dbo.GetSales @SaleDate, '''Outer Wear'', ''Mens'', ''Foot Wear'', ''N/A''';

    GO

    DB table has data.

    If hard code it like this:

    a.

    category...

  • RE: Select query that matches data with column names

    parthi-1705 (4/18/2011)


    Lynn Pettis (4/18/2011)


    Why all the function calls?

    select

    'id: ' + id + ';' +

    'name: ' + name + ';' +

    ...

Viewing 15 posts - 931 through 945 (of 1,229 total)