View Single Post

   
  #4 (permalink)  
Old 02-29-2008, 03:15 AM
TinTin
 
Posts: n/a
Default Re: Concatinating Variables

Hello John and Erland,

Thankyou for replying to my message.

As a matter or fact I have total of 52 variables.

These values are stored in an Excel spreadsheet. I use the DTS service
to import this spreadsheet into a temp table in SQL Server. Now I need
to catch these 53 different numeric values and parse them into
appropriate tabels in my Database. I use the Cursor to traverse
through the records in temp table and all these 53 values are Fetched
in 1 single record.

Hope this helps.

Regards!


"John Bell" <jbellnewsposts@hotmail.com> wrote in message news:<VbLzc.1167$hb6.9819346@news-text.cableinet.net>...
> Hi
>
> You will probably run into scope problems with this approach.
>
> There seems to be a design issue here, but without knowing more about the
> table strucures and what you are actually trying to do it is hard to suggest
> a better solution other than hard coding each one or (as per your previous
> post) look at using a temporary tables.
>
> John
>
> "TinTin" <lalalulu24@yahoo.com> wrote in message
> news:2d5425d1.0406151243.3bf0165a@posting.google.c om...
> > Hello,
> >
> > How do I concatinate a variable. Here's the scenarios:
> >
> > declare @var1 varchar(20)
> > declare @var2 varchar(20)
> > declare @var3 varchar(20)
> > declare @var4 varchar(20)
> > .
> > .
> > declare @var32 varchar(20)
> >
> > set @var1 = 'Something 1'
> > set @var2 = 'Something 2'
> > ...
> > set @var32 = 'Something 3'
> >
> > /* I have to store the values of these individual variables. I wish to
> > have a "While" routine which iterates through the above variables. I
> > wish to have the variable name concatinated as that I do not have to
> > write numerous lines of code setting up individual 32 variables. How
> > could I use the '+' operator to join 'var' + @count . Where count is
> > from 1 through 32. I am having some trouble with the syntax.*/
> >
> > Regards,
> > VS

Reply With Quote