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
 SQL Server Development (2000)
 Command text was not set for the command object

Author  Topic 

kirannatt
Yak Posting Veteran

66 Posts

Posted - 2006-08-24 : 18:00:22
hey all, I have created this stored proc which looks fine to me.
CREATE PROCEDURE Userinfo(
@UserID int
)
AS
SELECT 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 about

Thanks!

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 f
JOIN [User] u ON
u.UserID = f.CreatedBy
WHERE f.IsActive = 1


Nathan Skerl
Go to Top of Page

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.
Go to Top of Page

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.
Go to Top of Page

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
Go to Top of Page

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 object

objCommand.CommandText = 'EXEC UserInfo'

Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -