SQL Server Performance

select query

Discussion in 'General Developer Questions' started by kosh2059, Oct 17, 2006.

  1. kosh2059 New Member

    hi!

    how can i save the result of a select query in a vtext varible or somthing of that sort.
    that means i want it as plain text, just as if i would set the grid view to text view, only i want to automatcly keep the data stored on some var.

    thanks
  2. FrankKalis Moderator

    Any special reasons for that?

    Not too sound too theoretical, but the 1 of E.F.Codd's 12 rules states that data is presented in exactly one way as values in columns in rows. So, if you want to have such a table in a great array, I guess you have to perform an intermediate step and save the result of the query to a text file and read the content from there.

    --
    Frank Kalis
    Moderator
    Microsoft SQL Server MVP
    Webmaster:http://www.insidesql.de
  3. Adriaan New Member

    Would it be enough to have each row on a single column?

    DECLARE @Separator VARCHAR(3)
    DECLARE @t TABLE (BlobText TEXT)

    SET @Separator = '|'

    INSERT INTO @t
    SELECT col1 + @Separator + col2
    FROM mytable

    If there are nullable columns, add ISNULL.
    If there are non-alphanumeric columns, then CAST them individually.

Share This Page