Dropping SQL Tables Dynamically

Results 1 to 2 of 2

Thread: Dropping SQL Tables Dynamically

  1. #1
    Join Date
    Dec 1969

    Default Dropping SQL Tables Dynamically

    I need to run a stored procedure many times over and over. Essentially, I know I can use temporary tables to solve my problem but I need to have phycical tables when I am developing. I need, at the moment, to know how to delete a table if it exits. After this statement, I have code to create this table. <BR>My code is below -- Can someone please help?<BR><BR><BR>if exists (select * from sysobjects where id = object_id(&#039;dbo.vDSTurnedDown&#039;) and sysstat & 0xf = 4)<BR> drop Table dbo.vDSTurnedDown <BR>go<BR>Create Table vDSTurnedDown <BR>(<BR> Company varchar(50) null , <BR> Deal_Source varchar(50) null , <BR> Source varchar(50) null , <BR> Date_Plan_Rcvd datetime null, <BR> Niche varchar(100) null, <BR> Ind_Focus varchar(100) null, <BR> Internal_Notes varchar(100) Null <BR>)

  2. #2
    Join Date
    Dec 1969

    Default Ummm

    Just run your if exists statement again?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts