Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
hey all, I have created this stored proc which looks fine to me.CREATE PROCEDURE Userinfo( @UserID int)ASSELECT f.userID, f.userformName, f.userFormDescription, u.UserName, f.IsActive, f.DateCreated FROM Form f JOIN User u ON u.UserID = f.CreatedBy WHERE f.IsActive = 1 ORDER BY f.FormName RETURN But it gives me this error "Command text was not set for the command object"Can any of u know what is it complaining aboutThanks!
nathans
Aged Yak Warrior
938 Posts
Posted - 2006-08-24 : 18:05:26
You named a user table 'user'If you put that table in brackets does it solve the error?ex:
SELECT f.userID, f.userformName, f.userFormDescription, u.UserName, f.IsActive, f.DateCreated FROM Form fJOIN [User] u ON u.UserID = f.CreatedByWHERE f.IsActive = 1
Nathan Skerl
snSQL
Master Smack Fu Yak Hacker
1837 Posts
Posted - 2006-08-24 : 18:10:13
Is that error occurring in SQL Server or in ADO code that you're using when you try to call the stored procedure?It sounds like the error is in ADO code - check that you have the command correctly set up in your ADO code. Also in your stored procedure you create the parameter @UserID, but you never use it.
kirannatt
Yak Posting Veteran
66 Posts
Posted - 2006-08-24 : 18:32:17
[user] or by commenting @usedID didn't help. It runs fine on sql server side.
tkizer
Almighty SQL Goddess
38200 Posts
Posted - 2006-08-24 : 18:33:21
kirannatt, you need to provide the application code in order for us to help as the problem isn't in your stored procedure.Tara Kizer
SwePeso
Patron Saint of Lost Yaks
30421 Posts
Posted - 2006-08-25 : 01:15:47
You have to provide to code to execute with your command objectobjCommand.CommandText = 'EXEC UserInfo'Peter LarssonHelsingborg, Sweden