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 |
|
Trent
Starting Member
39 Posts |
Posted - 2006-01-13 : 12:57:48
|
| I have a function (part of the code is below) that uses the extended stored procedure sp_executesqlIt gives me the following error:Only functions and extended stored procedures can be executed from within a function.Doesn't that error mean that this should work?Thank you for any help!DECLARE @TableName nvarchar(64)DECLARE @SQLString nvarchar(1800)declare @TransX varchar(6)select @TableName = 'S' + @StudyNoselect @SQLString = 'select top 1 @TransX = TransX from MData.dbo.' + @TableName + ' where DatabaseID = ' + @TesterID + '' execute sp_executesql @SQLString, N'@TransX varchar(6) out', @TransX out |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-01-13 : 19:18:37
|
| sp_executesql is not an extented stored procedure.-----------------'KH'if you can't beat them, have someone else to beat them |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-01-13 : 20:29:38
|
quote: Originally posted by khtan sp_executesql is not an extented stored procedure.-----------------'KH'if you can't beat them, have someone else to beat them
It is an extended stored procedure, and shows that way in Enterprise Manager.CODO ERGO SUM |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-01-13 : 22:36:57
|
| >> It is an extended stored procedure, and shows that way in Enterprise Manager.Is it ? Always tot that extented SP are xp_-----------------'KH'if you can't beat them, have someone else to beat them |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-01-13 : 22:45:04
|
| MVJ, you are right. sysobjects.xtype is 'X' for sp_executesql-----------------'KH'if you can't beat them, have someone else to beat them |
 |
|
|
|
|
|
|
|