Query comparing dates in SQL

Instead of ‘2013-04-12’ whose meaning depends on the local culture, use ‘20130412’ which is recognized as the culture invariant format. If you want to compare with December 4th, you should write ‘20131204’. If you want to compare with April 12th, you should write ‘20130412’. The article Write International Transact-SQL Statements from SQL Server’s documentation explains how to … Read more

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.

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