Home > Archive > MS SQL Server > September 2005 > Decare @A









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Decare @A
Stanley

2005-09-30, 7:23 am

Hi all! I'm trying to set the value of @d to a value from col1 in
tblTest. I have tried the following code but it didn't work.

DECLARE @d VARCHAR(25)
SELECT * FROM tblTest
SET @d = tblTest.col1

Someone please help me! Thanks!

Nik Marshall-Blank \(delete fcom for my email addr

2005-09-30, 7:23 am

SELECT @d = col1 FROM tblTest

or

SET @d = SELECT col1 FROM tblTest

Where col1 is THE COLUMN NAME not the first column.

--
Nik Marshall-Blank MCSD/MCDBA

"Stanley" <xstanley@gmail.com> wrote in message
news:1128081085.771682.230680@f14g2000cwb.googlegroups.com...
> Hi all! I'm trying to set the value of @d to a value from col1 in
> tblTest. I have tried the following code but it didn't work.
>
> DECLARE @d VARCHAR(25)
> SELECT * FROM tblTest
> SET @d = tblTest.col1
>
> Someone please help me! Thanks!
>



SQL

2005-09-30, 7:23 am

DECLARE @d VARCHAR(25)
SELECT @d = col1 FROM tblTest

http://sqlservercode.blogspot.com/

"Stanley" wrote:

> Hi all! I'm trying to set the value of @d to a value from col1 in
> tblTest. I have tried the following code but it didn't work.
>
> DECLARE @d VARCHAR(25)
> SELECT * FROM tblTest
> SET @d = tblTest.col1
>
> Someone please help me! Thanks!
>
>

Stanley

2005-09-30, 9:23 am

Thanks so much, that's what I really need!!

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com