Viewing 15 posts - 17,971 through 17,985 (of 18,926 total)
or
IF Object_id('##table') > 0
begin
...
end
[Edit]
I don't know what you're talking about Noeld.. this works perfectly on my pc
.
BTW.. It's tag team not team tag...
April 28, 2005 at 2:53 pm
Can you post the table definition, some sample data. And what you are trying to accomlish
col1, col2, col3
1,2,3 >>move to tableV
1,2,4 delete if
4,6,9 >>move to tableY
April 28, 2005 at 2:51 pm
I just love that numbers table... so little things you can't do with it
.
April 28, 2005 at 2:16 pm
You can delete your post if you click the edit button. / then delete
April 28, 2005 at 1:42 pm
select ...
into #T1
from Source
where 1 = 0
--this forces to create the table only without inserting any rows, therefore taking virtually no time and releasing the locks immediatly.
April 28, 2005 at 1:16 pm
Why do they even do select into??? Can't a straight select be used to present the report?
Assuming that it can't be used, I'd strongly suggest creating a permanent reporting...
April 28, 2005 at 1:04 pm
You're right... I was assuming a bit column but it could be something else... It's just that = usually works faster that because indexes can be used.
Also should...
April 28, 2005 at 1:01 pm
How about this for faster solution :
GO
CREATE TABLE [Numbers] (
[PkNumber] [int] IDENTITY (1, 1) NOT NULL ,
CONSTRAINT [Pk_Number] PRIMARY KEY CLUSTERED
(
[PkNumber]
) ON [PRIMARY]
) ON [PRIMARY]
GO
Declare...
April 28, 2005 at 12:43 pm
oh ok... This is why we usually ask people to send us the real query with real tables. That way our responses work right away.
Good luck with the rest...
April 28, 2005 at 12:32 pm
Ya but with the gaz costs these days I'd keep it turned off
.
April 28, 2005 at 12:30 pm
You need the syntaxe to do the insert??
Insert into dbo.NewTempTable (Col1, col2...) Select Col1, Col2 from dbo.tempTable1
truncate tempTable1 to empty the main temp table.
April 28, 2005 at 12:29 pm
Just like a wrestle tag team match... The ring is yours Noeld
.
April 28, 2005 at 12:21 pm
Viewing 15 posts - 17,971 through 17,985 (of 18,926 total)