31 Ağustos 2016 Çarşamba

MSSQL Backup

RESTORE FILELISTONLY FROM DISK='C:\Db\Backup.bak'

RESTORE DATABASE Db_Name
FROM DISK = N'C:\Db\Backup.bak'
WITH
   MOVE 'backup_dbname' TO 'C:\MSSQL\DATA\Db_Name.mdf',
   MOVE 'backup_dbname_log' TO 'C:\MSSQL\DATA\Db_Name_log.ldf'
Go

30 Ağustos 2016 Salı

MSSQL Ortalama veri ekleme hızı

DECLARE @count int;
SET @count=(select count(0) from Table_Name)

DECLARE @start datetime;
DECLARE @end datetime;
DECLARE @datediff int;
Set @end=(select  top 1 CreatedDate from Table_Name order by CreatedDate desc)
SET @start=(select  top 1 CreatedDate from Table_Name order by CreatedDate )
SET @datediff=( select DATEDIFF(second,@start,@end) AS DIFFDATE)

print ltrim(str(@datediff))+' saniyede toplam '+ltrim(str(@count))+' veri eklendi.';
print 'Ortalama '+ltrim(str(@count/@datediff))+' veri/saniye';

28 Ağustos 2016 Pazar

SQL Shell (PSQL) Dump

click on the SQL Shell and log into the database and use import Server [localhost]: Database [postgres]: Port [5432]: Username [postgres]: Password for user postgres: psql (9.2.4) WARNING: Console code page (437) differs from Windows code page (1252) 8-bit characters might not work correctly. See psql reference page "Notes for Windows users" for details. Type "help" for help. postgres=# \i c:/data/data01.sql

20 Ağustos 2016 Cumartesi

Tarihe göe günlük kayıt sayısı

SELECT Convert(char(8), LogDate, 112), count(distinct RefundId) FROM RefundProcessing GROUP BY Convert(char(8), LogDate, 112)

15 Ağustos 2016 Pazartesi

Çalışma zamanı metot üretip çalıştırma

                Type type = Type.GetType("Namespace.ClassName");
                MethodInfo method = type.GetMethod("MethodName");
                object targetClass = Activator.CreateInstance(type);
                object[] paramters= new object[] { paramter1,..., parameterN };
                method.Invoke(targetClass, paramters);

10 Ağustos 2016 Çarşamba

.net 6 mapget kullanımı

 app.UseEndpoints(endpoints => {     endpoints.MapGet("/", async context =>     {         var response = JsonConvert.Seriali...