SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Hybrid View
-
Feb 5, 2005, 09:30 #1
- Join Date
- Jul 2004
- Location
- Nigeria
- Posts
- 1,737
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
MS SQL:Insert Command error message
Hi,
i have a command object for an insert. But keep getting this error message.
[Microsoft][ODBC SQL Server Driver][SQL Server]Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Now if i run the command for the first time and it does an insert into my db, it works fine.
However subsequent times, it gives the error message above.
what could be wrong here ?
thanks
Afrika
here is my code
Code:set create_sms_history = Server.CreateObject("ADODB.Command") create_sms_history.ActiveConnection = MM_mary_STRING create_sms_history.CommandText = "dbo.insert_sms_history_1" create_sms_history.Parameters.Append create_sms_history.CreateParameter("@RETURN_VALUE", 3, 4) create_sms_history.Parameters.Append create_sms_history.CreateParameter("@senderID", 200, 1,20,create_sms_history__senderID) create_sms_history.Parameters.Append create_sms_history.CreateParameter("@Receipient", 200, 1,20,create_sms_history__Receipient) create_sms_history.Parameters.Append create_sms_history.CreateParameter("@Username", 200, 1,20,create_sms_history__Username) create_sms_history.Parameters.Append create_sms_history.CreateParameter("@message", 200, 1,200,create_sms_history__message) create_sms_history.Parameters.Append create_sms_history.CreateParameter("@IP", 200, 1,25,create_sms_history__IP) create_sms_history.CommandType = 4 create_sms_history.CommandTimeout = 0 create_sms_history.Prepared = true create_sms_history.Execute()
-
Feb 5, 2005, 11:04 #2
- Join Date
- Jan 2005
- Location
- New York City
- Posts
- 244
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= ...
A subquery is something like this:
Code:select * from table where AccountBalance < (select MonthAmount from Balances where Month = 12)
Code:select * from table where AccountBalance < (select MonthAmount from Balances)
-Dan
-
Feb 5, 2005, 11:34 #3
- Join Date
- Jul 2004
- Location
- Nigeria
- Posts
- 1,737
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks Dan, but wasnt the problem
Aparently it was a trigger error.
Solved it, thanks Anyway
Afrika
Bookmarks