RE: Loading a variable

From: Alley (anonymous_at_discussions.microsoft.com)
Date: 01/12/05


Date: Wed, 12 Jan 2005 10:53:00 -0800

Sorry I want the variable to be char or varchar so that I
can email out the results using xp_sendmail.

>-----Original Message-----
>Try using a table variable...see the following article:
>
>http://www.aspfaq.com/show.asp?id=2475
>
>Brad Feaker
>Ex nihilo, nihil fit
>
>"Alley" wrote:
>
>> Let's say I have a simple three column table, temp27,
>> with a couple of rows in sql server 2000.
>>
>> How can I load "select * from temp27" into a
variable. I
>> am looking to do something like
>>
>> set @variablename = exec ('select * from temp27')
>>
>> but cannot get anything to work. Any tips would be
>> appreciated.
>>
>.
>



Relevant Pages

  • Re: Maintaining Field Length in .txt format
    ... If the types are VARCHAR, ... converts them to CHAR types. ... >are on a SQL Server 2000 environment and I can create ... The header information for the feed to be ...
    (microsoft.public.sqlserver.programming)
  • Re: returning @@RowCount
    ... use VARCHAR. ... CHAR will pad the data with spaces ... SQL Server MVP ... >> alter procedure stp_Family ...
    (microsoft.public.sqlserver.programming)
  • Re: Loading a variable
    ... Sorry I want the variable to be char or varchar so that I ... >> Let's say I have a simple three column table, temp27, ... >> with a couple of rows in sql server 2000. ...
    (microsoft.public.sqlserver.server)
  • Re: Data types
    ... If the data is variably sized, use varchar. ... Programming with fixed length char value is a pain. ... Pro SQL Server 2000 Database Design - ...
    (microsoft.public.sqlserver.programming)
  • Re: Conversion error
    ... You canimport both types of data into a varchar column now. ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ... www.SQLDTS.com - The site for all your DTS needs. ... >>character data has to be one or the other. ...
    (microsoft.public.sqlserver.dts)