Following implementation of temporary tables which can be used to replace stored procedure.
--checking if exist
IF OBJECT_ID('tempdb..#temp') IS NULL
begin
CREATE TABLE #tempTable1 (
field1 datetime NOT NULL
)
end
--adding data
insert into #tempTable1
select top 1 date from anytable
--do what ever here
select * from #tempTable1
--finaly destroy it
DROP TABLE tempdb..#tempTable1
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment