Showing posts with label therei. Show all posts
Showing posts with label therei. Show all posts

Sunday, March 25, 2012

Cannot drop Temporary Table linked to Connection

Hi there!

I have a Java-Servlet that opens a connection to a SQL-Server 2000
With this connection I create a temporary local table.
I can call the temporary table within this connection as often as I want ... it's there as long as the connection is open. It's not dropped automatically as long as the connection is open. But when want to drop that table MANUALLY, I get a

[Microsoft][SQLServer JDBC Driver][SQLServer]Cannot drop the table '#tablename', because it does not exist in the system catalog.

I don't use any stored procedures that could drop the table before I do.
The database is accessed only by "normal" sql-statements through the JDBC-Driver. I can read the content of the table 10 times but if I try to drop it just in the next line, I get the above error message.

Now I know that the table will be dropped as soon as I close the connection, but anyway it's safer to do it manually ... so has somebody an idea?

Thanks

LookDo you need repeated access to the temp table or is it used just once ? Also, can you send the code you are using ? Is it straight sql or are you using a stored procedure (it appears that you are doing straight sql)?|||Found this in MSDN. Look for the article "Coding T-SQL like an Expert"

IF (object_id('tempdb..#mytemp') IS not Null)
Drop Table #mytemp

Although `tempdb..#authors_temp' is a truncation of the actual physical name of the object as held in tempdb..sysobjects, somehow OBJECT_ID() recognizes that you mean "your" temporary table called #mytemp.

Thursday, March 22, 2012

Cannot delete Sequence Container Error: Collection cannot be null. Parameter name: c

I have a Sequence Container with an Exec SQL Task in it. I can't delete the task or the container. I can't disable them.

Here's how I got there:

I put a Dataflow Task and the Exec SQL Task in the container, then set a precedence constraint. Lots of complaints moving either of them. Managed to delete the Dataflow Task, but now can't do anything.

Any dieas?

Laurence

Collection cannot be null.
Parameter name: c (Microsoft Visual Studio)


Program Location:

at System.Collections.ArrayList.InsertRange(Int32 index, ICollection c)
at System.Collections.ArrayList.AddRange(ICollection c)
at Microsoft.DataTransformationServices.Design.DtsBasePackageDesigner.OnComponentRemoving(Object sender, ComponentEventArgs ce)
at Microsoft.DataTransformationServices.Design.DtrPackageDesigner.OnComponentRemoving(Object sender, ComponentEventArgs ce)
at System.ComponentModel.Design.ComponentEventHandler.Invoke(Object sender, ComponentEventArgs e)
at System.ComponentModel.Design.DesignerHost.RemoveFromContainerPreProcess(IComponent component, IContainer container)
at System.ComponentModel.Design.DesignerHost.Remove(IComponent component)
at Microsoft.DataWarehouse.Design.ClipboardCommandHelper.OnMenuDelete(MenuCommand sender, CommandHandlingArgs args)
at Microsoft.DataWarehouse.Design.CommandHandlingInfoMap.HandleCommand(MenuCommand menuCommand)
at Microsoft.DataWarehouse.Design.ClipboardCommandHelper.Microsoft.DataWarehouse.Interfaces.ICommandTarget.InvokeCommand(MenuCommand menuCommand)
at Microsoft.DataWarehouse.Design.ComponentDiagram.InvokeCommand(MenuCommand menuCommand)
at Microsoft.DataWarehouse.Design.ComponentDiagram.Microsoft.DataWarehouse.Interfaces.ICommandTarget.InvokeCommand(MenuCommand menuCommand)

More Details

Cannot delete Sequence Container -- details

I have a Sequence Container with an Exec SQL Task in it. I can't delete the task or the container. I can't disable them.

Here's how I got there:

I put a Dataflow Task and the Exec SQL Task in the container, then set a precedence constraint. Lots of complaints moving either of them. Managed to delete the Dataflow Task, but now can't do anything.

Any dieas?

Laurence

Collection cannot be null.
Parameter name: c (Microsoft Visual Studio)


Program Location:

at System.Collections.ArrayList.InsertRange(Int32 index, ICollection c)
at System.Collections.ArrayList.AddRange(ICollection c)
at Microsoft.DataTransformationServices.Design.DtsBasePackageDesigner.OnComponentRemoving(Object sender, ComponentEventArgs ce)
at Microsoft.DataTransformationServices.Design.DtrPackageDesigner.OnComponentRemoving(Object sender, ComponentEventArgs ce)
at System.ComponentModel.Design.ComponentEventHandler.Invoke(Object sender, ComponentEventArgs e)
at System.ComponentModel.Design.DesignerHost.RemoveFromContainerPreProcess(IComponent component, IContainer container)
at System.ComponentModel.Design.DesignerHost.Remove(IComponent component)
at Microsoft.DataWarehouse.Design.ClipboardCommandHelper.OnMenuDelete(MenuCommand sender, CommandHandlingArgs args)
at Microsoft.DataWarehouse.Design.CommandHandlingInfoMap.HandleCommand(MenuCommand menuCommand)
at Microsoft.DataWarehouse.Design.ClipboardCommandHelper.Microsoft.DataWarehouse.Interfaces.ICommandTarget.InvokeCommand(MenuCommand menuCommand)
at Microsoft.DataWarehouse.Design.ComponentDiagram.InvokeCommand(MenuCommand menuCommand)
at Microsoft.DataWarehouse.Design.ComponentDiagram.Microsoft.DataWarehouse.Interfaces.ICommandTarget.InvokeCommand(MenuCommand menuCommand)

More Details

sql