Re: how to assign the contents of a field to a variable
From: Aaron [SQL Server MVP] (ten.xoc_at_dnartreb.noraa)
Date: 07/13/04
- Next message: John Francisco Williams: "IsNumeric and Cast"
- Previous message: PeterNunez: "List table and field names"
- In reply to: Robin Boyd: "how to assign the contents of a field to a variable"
- Next in thread: Mischa Sandberg: "Re: how to assign the contents of a field to a variable"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Jul 2004 10:38:49 -0400
-- http://www.aspfaq.com/ (Reverse address to reply.) "Robin Boyd" <none@nowhere.com> wrote in message news:cd0rpp$1ni$1@ork.noris.net... > Hi all, > > I am trying to assing the value of a field (stored in a variable) to another > variable. I have tried various approaches with no success :( > > here is the code I am working with... > > --SELECT@CurrFieldValue = CustomerID FROM[Inserted] > SET @MySQL = 'SELECT @CurrFieldValue = ' + @CurrFieldName + ' FROM > [Inserted]' > EXECUTE @MySQL > > > I currently get the following error message: > The name 'SELECT @CurrFieldValue = CustomerID FROM [Inserted]' is not a > valid identifier. > > The commented lien works perfectly, however as I execute this code from > within a loop (for all the fields in the table) this is no good. > > Any help, pointers or such, most welcome! > > Thanks in advance, > Robin Boyd > >
- Next message: John Francisco Williams: "IsNumeric and Cast"
- Previous message: PeterNunez: "List table and field names"
- In reply to: Robin Boyd: "how to assign the contents of a field to a variable"
- Next in thread: Mischa Sandberg: "Re: how to assign the contents of a field to a variable"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|