วันพุธที่ 14 มีนาคม พ.ศ. 2561

SQL Server : Delete multiple Stored Procedures in One Database

SELECT 'DROP PROCEDURE [' + SCHEMA_NAME(p.schema_id) + '].[' + p.NAME + ']'
FROM sys.procedures p  WHERE p.name like 'SSIS%'
ORDER BY p.name

SQL Server : Delete all tables in a SQL Server database

DECLARE @Sql NVARCHAR(500) DECLARE @Cursor CURSOR

SET @Cursor = CURSOR FAST_FORWARD FOR
SELECT DISTINCT sql = 'ALTER TABLE [' + tc2.TABLE_NAME + '] DROP [' + rc1.CONSTRAINT_NAME + ']'
FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc1
LEFT JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc2 ON tc2.CONSTRAINT_NAME =rc1.CONSTRAINT_NAME

OPEN @Cursor FETCH NEXT FROM @Cursor INTO @Sql

WHILE (@@FETCH_STATUS = 0)
BEGIN
Exec sp_executesql @Sql
FETCH NEXT FROM @Cursor INTO @Sql
END

CLOSE @Cursor DEALLOCATE @Cursor
GO

EXEC sp_MSforeachtable 'DROP TABLE ?'
GO

Windows 10: Windows Update error 0x8024401c

Windows Update Error Message : There were some problems installing updates, but we'll try again later. If you keep seeing this and want to search the web or contact support for information, this may help: (0x8024401c)

2. Download Fix Windows Update program.



 3. Save.


4. When you success download Click run program.
5. Select Next and follow the steps.


Search Table Name of all database [ ค้นหาชือ Table ใน Database server ทั้งหมด ]

  -------------- -- Search Table Name inside database server -- 1. -------------- DECLARE @SearchTerm NVARCHAR ( 100 ) = '% TableN...