Forum Replies Created

Viewing 15 posts - 301 through 315 (of 621 total)

  • RE: Insert Into Query Produces Duplicate Rows

    Daryl, if you post some table structure and sample data, someone can probably help you figure it out.

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • RE: Saving Text datatypes

    I'm no expert on this stuff by any means, but BOL says...

    text

    Variable-length non-Unicode data in the code page of the server and with a maximum length of 231-1 (2,147,483,647) characters....

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • RE: How many bottles will fit in a box?

    You need to know the dimensions of the bottles, not necessarily only the volume. Why don't you make one of each size box, and see which one holds the...

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • RE: How to find occurances of a data in several tables?

    Probably should be one "datum" 🙂

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • RE: More query help

    Maybe you could just add it as another parameter in one of your stored procedures?

    USE [OHT]

    GO

    /****** Object: StoredProcedure [dbo].[GetLookingFor] Script Date: 05/18/2009 11:09:30 ******/

    SET ANSI_NULLS ON

    GO

    SET...

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • RE: confused by user defined functions

    GSquared (5/19/2009)


    Get rid of the semicolons, the function will still run, it's just less "clean".

    I often see code with semicolons here, but usually without. I have queried in DB2...

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • RE: please give a recursive query for my problem..

    Check out Books On Line for "expanding heirarchies"

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • RE: Transpose table with unknown number of fields

    Chris, this seems like a much better solution than mine. After messing around with it a bit, I can understand what it is doing for the most part, but...

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • RE: Table variable error in dynamic SQL

    Lynn Pettis (5/14/2009)


    It is a scope issue.

    Ah ha. Not too familiar with what scope is, or how it affects things. Thanks for the tip.

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • RE: Table variable error in dynamic SQL

    Christopher Stobbs (5/14/2009)


    Have you tried using the system tables in SQL?

    Here is a dynamic unpivot solution with not temp tables or table variables.

    I must admit that I found this code...

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • RE: Table variable error in dynamic SQL

    mdowns (5/14/2009)


    I think you will find you can't INSERT .... EXEC into a table variable in SQL Server 2000. It has to be SQL Server 2005 or higher.

    Why not just...

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • RE: Table variable error in dynamic SQL

    Christopher Stobbs (5/14/2009)


    are you sure that happycat59's solution above does not work it works for me?

    Or you could try this:

    DECLARE @sql VARCHAR(200)

    SELECT @sql = 'DECLARE @table TABLE

    (

    col1 CHAR(1)

    )

    INSERT INTO @table...

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • RE: Table variable error in dynamic SQL

    Thanks both, but its back to the drawing board. When I tried your solutions, I got...

    Server: Msg 197, Level 15, State 1, Line 7

    EXECUTE cannot be used as a...

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • RE: Transpose table with unknown number of fields

    Well, I guess I can now also take the liberty of assuming maybe this is not what the OP was looking for. (crickets chirping)

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • RE: Transposing data from Columns to Rows

    See if this article does not give you what you need.

    http://www.sqlservercentral.com/articles/Test+Data/61572/

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

Viewing 15 posts - 301 through 315 (of 621 total)