Saving changes after table edit in SQL Server Management Studio

Go into Tools -> Options -> Designers-> Uncheck “Prevent saving changes that require table re-creation”. Voila. That happens because sometimes it is necessary to drop and recreate a table in order to change something. This can take a while, since all data must be copied to a temp table and then re-inserted in the new … Read more

How to fetch the row count for all tables in a SQL SERVER database [duplicate]

The following SQL will get you the row count of all tables in a database: CREATE TABLE #counts ( table_name varchar(255), row_count int ) EXEC sp_MSForEachTable @command1=’INSERT #counts (table_name, row_count) SELECT ”?”, COUNT(*) FROM ?’ SELECT table_name, row_count FROM #counts ORDER BY table_name, row_count DESC DROP TABLE #counts The output will be a list of … Read more

How to convert all tables from MyISAM into InnoDB?

Run this SQL statement (in the MySQL client, phpMyAdmin, or wherever) to retrieve all the MyISAM tables in your database. Replace value of the name_of_your_db variable with your database name. SET @DATABASE_NAME = ‘name_of_your_db’; SELECT CONCAT(‘ALTER TABLE `’, table_name, ‘` ENGINE=InnoDB;’) AS sql_statements FROM information_schema.tables AS tb WHERE table_schema = @DATABASE_NAME AND `ENGINE` = ‘MyISAM’ … Read more

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