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.
| Author |
Topic |
|
binggeli
Starting Member
20 Posts |
Posted - 2005-11-08 : 10:06:07
|
| Is there any way to use the contents of a TEXT fieldin a subquery within a Stored Procedure?My situation:Need to copy partial row information fromexisting table "A" with INT, VARCHAR and TEXT fields into existing table "B" -- thisis custom work for one of our clients whodoes not want to have to do this manuallyfor 1,000's of users in an HR system.However, the TEXT field in question has never more than 500 characters, so I wouldbe happy if I could even do something with VARCHAR(500) (say, in a variable).Nothing I've tried seemed to work.I can't CAST the contents of the TEXT fieldinto VARCHAR.I can't use SUBSTRING.I can't use LEFT or any of those stringfunctions.Keep getting the "The text, ntext, and image data types are invalid in this subquery or aggregate expression." message.Any ideas or suggestions?Thank you,Dee |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
binggeli
Starting Member
20 Posts |
Posted - 2005-11-08 : 10:21:39
|
| Thank you!It worked. I can't tell you how grateful I am for your solution.Sometimes you guys just make my day!Thanks much,Dee |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-09 : 01:01:10
|
| >>I can't use SUBSTRING.Substring will work on TEXT ColumnSelect SubString(TextCol,1,500) from yourTableMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|