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

Use the INFORMATION_SCHEMA.TABLES view to get the list of tables. Generate Drop scripts in the select statement and drop it using Dynamic SQL: Sys.Tables Version Note: If you have any foreign Keys defined between tables then first run the below query to disable all foreign keys present in your database. For more information, check here.

Query error with ambiguous column name in SQL

We face this error when we are selecting data from more than one tables by joining tables and at least one of the selected columns (it will also happen when use * to select all columns) exist with same name in more than one tables (our selected/joined tables). In that case we must have to specify from which table we are … Read more

BCP error “Unable to open BCP host data-file”

From the error I take, that the data file cannot be opened: I think, you have to add a filename behind the \Desktop. Desktop is an existing directory and cannot be opened as file … And – btw – it might be necessary to add -S Servername… UPDATE Found this here Whenever I get this message, it’s because of one … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)