![]() | |
![]() |
| | Thread Tools | Display Modes |
#21
| |||
| |||
|
|
Devasena, I suspect that you code actually looks like this, with a # before the rest of the name. Select * into #tmp_table1 from table1 It is a matter of the scope (the lifetime) of the temporary table. From the BOL: http://msdn.microsoft.com/en-us/library/ms345368.aspx "User objects are explicitly created by the user. These objects may be in the scope of a user session or in the scope of the routine in which the object is created." In the query window, once you have created #tmp_table1 in that window, it will exist until you get rid of it. However, if you open another query window you will be able to create #tmp_table1 there, but only one time. As you close windows, or delete #tmp_table1 it will disappear. If a stored procedure created #tmp_table1 internally, it would be deleted when the the stored procedure returned. Therefore, since your VB code is probably opening and closing connections the temporary tables are dropped each time the connection drops. RLF "Raghu Raman" <raghuraman_ace (AT) rediffmail (DOT) com> wrote in message news:u7EF0AzHJHA.788 (AT) TK2MSFTNGP06 (DOT) phx.gbl... Hi This is my sql query . Select * into tmp_table1 from table1 . If i the above query more than once in the sqlserver 2000 DB , it shows the error 'There is already an object named 't1' in the database.' But if i use the same from the VB6 GUI , i dont get any error . In this case , shall i assume that eventhough more than one users try to execute same 'select into' query from VB GUI , they all get the correct result .Would't they get any errors ? Please advice. Thanks Devasena Six faces rule the world *** Sent via Developersdex http://www.developersdex.com *** |
![]() |
| Thread Tools | |
| Display Modes | |
| |