DBHelper

所属分类:SQL Server
开发工具:C#
文件大小:58KB
下载次数:0
上传日期:2022-07-06 19:29:12
上 传 者sh-1993
说明:  详细的解释可以在红门SimpleTalk的链接“用SQL Server管理编程SQL Server”中找到...
(The detailed explanation could be found on Red Gate SimpleTalk s link Programming SQL Server with SQL Server Management Objects Framework <https://www.red-gate.com/simple-talk/dotnet/c-programming/programming-sql- server-sql-server-management-objects-framework/>)

文件列表:
DBHelper.sln (2694, 2022-07-07)
DBHelper (0, 2022-07-07)
DBHelper\DBGeneral.cs (58230, 2022-07-07)
DBHelper\DBHelper.csproj (3768, 2022-07-07)
DBHelper\Extension (0, 2022-07-07)
DBHelper\Extension\ExceptionExtension.cs (1047, 2022-07-07)
DBHelper\Properties (0, 2022-07-07)
DBHelper\Properties\AssemblyInfo.cs (1387, 2022-07-07)
IOHelper (0, 2022-07-07)
IOHelper\Common (0, 2022-07-07)
IOHelper\Common\DriveHelper.cs (773, 2022-07-07)
IOHelper\DataBase (0, 2022-07-07)
IOHelper\DataBase\PostDeployment.sql (1862, 2022-07-07)
IOHelper\DataBase\PreDeployment.sql (2077, 2022-07-07)
IOHelper\Functions (0, 2022-07-07)
IOHelper\Functions\FileHelper.cs (812, 2022-07-07)
IOHelper\IOHelper.sqlproj (4541, 2022-07-07)
IOHelper\IoHelper.snk (596, 2022-07-07)
IOHelper\Properties (0, 2022-07-07)
IOHelper\Properties\AssemblyInfo.cs (793, 2022-07-07)
IOHelper\Stored procedure (0, 2022-07-07)
IOHelper\Stored procedure\DeleteFiles.cs (1178, 2022-07-07)
IOHelper\Stored procedure\FreeSpace.cs (899, 2022-07-07)
IOHelper\Test (0, 2022-07-07)
IOHelper\Test\Test.sql (1214, 2022-07-07)
SmoIntroduction (0, 2022-07-07)
SmoIntroduction\App.config (721, 2022-07-07)
SmoIntroduction\CreateGraph.cs (16126, 2022-07-07)
SmoIntroduction\CreateMOTable.cs (9154, 2022-07-07)
SmoIntroduction\CreatePartitionScheme.cs (4840, 2022-07-07)
SmoIntroduction\CreateStoredProc.cs (3422, 2022-07-07)
SmoIntroduction\CreateSysVerTempTables.cs (4337, 2022-07-07)
SmoIntroduction\CreateTable.cs (6659, 2022-07-07)
SmoIntroduction\ExtProperties.cs (11895, 2022-07-07)
SmoIntroduction\ExtendedEvents.cs (2723, 2022-07-07)
SmoIntroduction\Extension (0, 2022-07-07)
... ...

## :white_check_mark: DBHelper SMO library which has, as a result, a DLL. In the library, you can find a lot of methods to work with SQL Server database. Method description | Method signature -------------------------------------------------|--------------------------------------------------------------------------------- To ensure a backup certificate exists | EnsureBackupCertificateExists(ServerConnection,Ilog,ref string,string) To create a backup certificate | CreateBackupCertificate(ServerConnection,ILog,string,string,ref string, bool) To take a copy only backup | BackupDatabase(ServerConnection,ILog,ref string, bool) To perform database check | CheckDb(ServerConnection, ILog , ref string ) To put database in user access mode | PutDbInUserMode(ServerConnection, DatabaseUserAccess ,bool, ILog, ref string) To kill all user process for particular database | KillAllProcessesForOneDatabase(ServerConnection, ref string) To determine the log size | DetermineLogSize(ServerConnection,ref string) To set database in particular recovery mode | SetRecoveryMode(ServerConnection,RecoveryModel,bool, ILog , ref string) To restore the database | RestoreDatabase(ServerConnection, ILog, ref string) To shrink the database log | ShrinkLog(ServerConnection,int,ILog,ref string) To determine is the database online | IsTheDataBaseOnLine(ServerConnection, ILog, ref string) ## :white_check_mark: IOHeLper SQLCLR project which has, as a result, a DLL that should be published on the database server. Method description | Method signature ---------------------------------- |-------------------------------------------------------------------------------------------- Can I perform backup? | CanIPerformABackup(ServerConnection, ILog , ref string, DiskSizeUnit ) To delete old backup files | DeleteBackupFiles(ServerConnection, ILog, ref string) To determine number and size | DetermineNumberOfBackupFiles(ServerConnection, ILog, ref int, ref Int***,ref string) ## :white_check_mark: Tester A console application that could be useful to make some tests. ## :white_check_mark: SmoIntroduction Class Name | Class Description ----------------------------------|-------------------------------------------------------------------------------------------- CreateGraph | Shows how to create NODE & EDGE tables CreateMOTable | Shows how to create the memory optimized tables CreatePartitionScheme | Shows how to create the partition scheme and the partition function CreateStoredProc | Shows how to create the stored procedure CreateSysVerTempTables | Shows how to create system-versioned ( temporal ) tables CreateTable | Shows how to create traditional - disk based tables ExtProperties | Shows how to manipulate with extended properties ExtendedEvents | Shows how to manipulate with extended events ( create session, add targets, add events ) ListAllUserDefinedDataTypes | Shows how to get and recreate all user-defined data type in a database RebuildIndexes | Shows how to rebuild indexes and update statistics ServerConfiguration | Shows how to get the server configuration ServerEvents | Shows how to subsribe to server events SetDefaultInitField | Shows how to reduce the amount of T-SQL needed for object initialisation TDE | Shows how to encrypt the database

近期下载者

相关文件


收藏者