About 50 results
Open links in new tab
  1. sql server - How to drop a table if it exists? - Stack Overflow

    DROP TABLE IF EXISTS dbo.Scores Reference: DROP IF EXISTS - new thing in SQL Server 2016 It will be in SQL Azure Database soon.

  2. Correct way to drop a table in SQL Server - Stack Overflow

    What is the best way to drop a table? The code I have does it two different ways. It will be dropped every week when I do a bulk insert. Thanks. Like this? IF EXISTS (SELECT * FROM DBO.

  3. What is the difference between drop table and delete table in SQL …

    In the delete object GUI, on top there is a 'script' option which gives the t-sql statement which is plain drop table statement. Where as when you go for the drop table option, the t-sql generated would …

  4. How to drop all tables in a SQL Server database?

    Dec 9, 2011 · You can also delete all tables from a database using only the SSMS UI tools (without using a SQL script). Sometimes, this method can be more convenient, especially if it is performed …

  5. How to DROP multiple columns with a single ALTER TABLE statement …

    Jun 14, 2011 · I would like to write a single SQL command to drop multiple columns from a single table in one ALTER TABLE statement. From MSDN's ALTER TABLE documentation... DROP { …

  6. sql - Drop a temporary table if it exists - Stack Overflow

    I have two lines of code in SQL that create two tables on the fly, i need to do something like IF TABLE EXISTS DROP IT AND CREATE IT AGAIN ELSE CREATE IT my lines are the following ones ...

  7. sql server - Check if a temporary table exists and delete if it exists ...

    I am using the following code to check if the temporary table exists and drop the table if it exists before creating again. It works fine as long as I don't change the columns. If I add a column la...

  8. How to drop all tables from a database with one SQL query?

    Dec 23, 2014 · EXEC sp_MSforeachtable @command1 = "DROP TABLE ?" This is a hidden Stored Procedure in sql server, and will be executed for each table in the database you're connected. Note: …

  9. sql server - On my local machine, I am unable to drop a table because ...

    Feb 17, 2023 · The SQL Server DROP TABLE IF EXISTS Examples shows all these options. Use DROP TABLE IF EXISTS unless you really need to work with an unsupported database version.

  10. Drop all tables whose names begin with a certain string

    Aug 7, 2008 · How can I drop all tables whose names begin with a given string? I think this can be done with some dynamic SQL and the INFORMATION_SCHEMA tables.