Skip to main content

Posts

Showing posts with the label mssql

Delete all tables of a database

Below SQL select statement create list of SQLs to delete all tables For ORACLE schema SELECT 'DROP TABLE "' || TABLE_NAME || '" CASCADE CONSTRAINTS;' FROM user_tables; For MSSQL schema use [database_name] SELECT   'DROP TABLE {user} .'   +   NAME   FROM  sys.objects where type = 'U'; Where {user} is the owning user of the tables. (drop all tables of database)

שינוי מאפייני שפה של שרת MSSQL

Change collation of MSSQL From Changing SQL Server Collation After Installation >> sc queryex type= service state= all | find /i "SQL Server" DISPLAY_NAME: SQL Server (MSSQLSERVER) DISPLAY_NAME: SQL Server Browser DISPLAY_NAME: SQL Server Agent (MSSQLSERVER) DISPLAY_NAME: SQL Server VSS Writer >> net stop "SQL Server (MSSQLSERVER)" The SQL Server (MSSQLSERVER) service is stopping.... The SQL Server (MSSQLSERVER) service was stopped successfully. cd c:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn\ -- SET CASE SENSITIVE -- sqlservr -m -T4022 -T3659 -s"MSSQLSERVER" -q"SQL_Latin1_General_CP1_CS_AS" [-m] single user admin mode   [-T] trace flag turned on at startup   [-s] sql server instance name   [-q] new collation to be applied -- SET CASE IN-SENSITIVE -- sqlservr -m -T4022 -T3659 -s"MSSQLSERVER" -q"SQL_Latin1_General_CP1_CI_AS" ...