Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 How to assign value to a text variable

Author  Topic 

ikhuram
Starting Member

28 Posts

Posted - 2004-05-28 : 05:23:52
I want to assign value to a text variable, How can I do this?
e.g.,


declare @select text, @sql text

SELECT @select=stuff(@select, charindex(' FROM ', @select)+1, 0, ', ' + @sql + ' ')

raymondpeacock
Constraint Violating Yak Guru

367 Posts

Posted - 2004-05-28 : 06:30:33
You can't have text variable types in SQL Server.


Raymond
Go to Top of Page

mfemenel
Professor Frink

1421 Posts

Posted - 2004-05-28 : 10:24:01
You can have text parameters though. Like this:
create procedure test1
@mytextvar text
as
select @mytextvar

If you got creative, I'm sure you could find a way to work around not being able to assign it within a stored procedure.

Mike
"oh, that monkey is going to pay"
Go to Top of Page
   

- Advertisement -