Using 'Execute SQL Task' to insert rows



Hi there all,

I'm trying to insert a number of rows into a table using the results of a
sub-query to populate them.
They're both on the same connection.

When I parse this, it's fine. When I execute it, I get this message:
"Error Source : Microsoft OLE DB Provider for SQL Server'

Error Description : The statement has been terminated.
Subquery returned more than 1 value. This is not permitted when the subquery
follows =, !=, <, <=, >, >= or when the subquery is used as an expression."

What am I doing wrong?!
Here's my SQL statement:

----------------------------------------
INSERT INTO dbo.ExportUpdates
(exup_collisionID, exup_addedat)
SELECT DISTINCT col_id, GETDATE() AS CurrDate
FROM dbo.Collisions
----------------------------------------

I'm going quite mad looking at this so any help would be much appreciated!

Cheers,
Foss
.



Relevant Pages

  • RE: Problem using parameters in query
    ... The .NET Framework Data Provider for SQL Server does not support the question ... mark placeholder for passing parameters to a SQL Statement or a stored ... > If I check what the commandtext is the sqlstatement has not changed from the ... > Also when I execute the query. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Retrieving Identity Values after DetailsView Insert
    ... Yes, so far for those autogenerated ID, SQL Server won't return it ... automaticaly since standard insert SQL statement doesn't contains ... We need to use additional query to retrieve ... you're welcome to submit such request for the SqlDataSource control ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: SQL Query
    ... Is Date_Created a varchar() or charfield? ... If a datetime field, you will have to set up the query to get the number of ... I need to count the number of records on a Day in SQL Server ... What will the SQL Statement be? ...
    (microsoft.public.dotnet.framework)
  • Re: Writing a GUID to a SQL table
    ... Microsoft OLE DB Provider for SQL Server error '80040e14' ... >> The response.write displays a perfectly formed GUID, ... > We cannot debug a sql statement without knowing what it is. ... This email account is my spam trap so I ...
    (microsoft.public.inetserver.asp.db)
  • RE: Using a column variable in an Insert Stored procedure
    ... actually the content of the @Table variable (sysname) that the sp sends to ... I'm at a loss as to why SQL Server is returning this error. ... > Generally this error message is telling you that the specified object does ... > need to look into creating an add hoc sql statement using the sp_executesql ...
    (microsoft.public.sqlserver.programming)