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 |
|
charlesmorris
Starting Member
11 Posts |
Posted - 2001-06-27 : 18:47:42
|
| Ok, I'm a part-time SQL developer and I'm stuck on something that seems like it should be simple. I've stripped all the unnecessary code out of my example except the applicable and offensive code =)Given SQL Server6.5 and the following SQL:=========================================CREATE PROCEDURE sp_THISSUX ASdeclare @strOutput varchar(255)declare @SQLString varchar(255)Set @SQLString = 'Select @strOutput = data from mycooldatabase'EXEC @SQLString @StrOutput OUTPUT==========================================What happens is SQL Server looks for a SP called:'Select @strOutput = data from mycooldatabase'It throws an error saying the SP does not exist (well duh) as opposed tojust executing the string. How is this done? I understand that in SQL7/2000 there is a SP called sp_ExecuteSQL that will fix my problem, but were running on 6.5 still...TIA,Charles |
|
|
|
|
|