Tuesday, March 24, 2015

Set mime types for web fonts in IIS

A typical @font-face declaration includes a .eot file, a .svg file, a .ttf file and a .woff file. If your IIS does not serve any of the previous file types, you need to set the appropriate mime type.

Simply add the following MIME type declarations via IIS Manager (HTTP Headers tab of website properties):
.eot   application/vnd.ms-fontobject
.ttf   application/octet-stream
.svg   image/svg+xml
.woff  application/font-woff
If you do not have access to the IIS Manager, you can add these declarations in your Web.config file, in the <system.webServer> section.
<system.webServer>
    <staticContent>
        <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
        <mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
        <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
        <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
    </staticContent>
</system.webServer>

Friday, March 13, 2015

restore sql server .bak and .trn series full backup and transaction log files restore process

script to restore .bak file and following transaction log files taken after this full backup script


Use Master

--Alter Database HBDB
--SET SINGLE_USER With ROLLBACK IMMEDIATE
RESTORE DATABASE HBDB FROM DISK = 'C:\last backup\HBDB_backup_2015_03_13_142615_7466371.bak' WITH NORECOVERY

RESTORE LOG HBDB FROM DISK = 'C:\last backup\HBDB_backup_2015_03_13_143001_3743946.trn' WITH NORECOVERY
GO
RESTORE LOG HBDB FROM DISK = 'C:\last backup\HBDB_backup_2015_03_13_143301_4693971.trn'
GO



ANOTHER EXAMPLE

Use Master

RESTORE DATABASE archive_Test FROM DISK = 'E:\Production DBs Backups\HOSPITAL_DB\HOSPITAL_DB_backup_2015_03_20_220000_9391391.bak' WITH REPLACE , NORECOVERY
RESTORE LOG archive_Test FROM DISK = 'E:\Production DBs Backups\HOSPITAL_DB\HOSPITAL_DB_backup_2015_03_20_222001_5446562.trn' WITH NORECOVERY
RESTORE LOG archive_Test FROM DISK = 'E:\Production DBs Backups\HOSPITAL_DB\HOSPITAL_DB_backup_2015_03_20_224001_1110761.trn' WITH NORECOVERY
RESTORE LOG archive_Test FROM DISK = 'E:\Production DBs Backups\HOSPITAL_DB\HOSPITAL_DB_backup_2015_03_20_230001_6931427.trn' WITH NORECOVERY
RESTORE LOG archive_Test FROM DISK = 'E:\Production DBs Backups\HOSPITAL_DB\HOSPITAL_DB_backup_2015_03_20_232001_3078836.trn' WITH NORECOVERY
RESTORE LOG archive_Test FROM DISK = 'E:\Production DBs Backups\HOSPITAL_DB\HOSPITAL_DB_backup_2015_03_20_234001_9216614.trn' WITH NORECOVERY
RESTORE LOG archive_Test FROM DISK = 'E:\Production DBs Backups\HOSPITAL_DB\HOSPITAL_DB_backup_2015_03_21_000001_5006193.trn' WITH NORECOVERY
RESTORE LOG archive_Test FROM DISK = 'E:\Production DBs Backups\HOSPITAL_DB\HOSPITAL_DB_backup_2015_03_21_002001_0712952.trn' WITH NORECOVERY
RESTORE LOG archive_Test FROM DISK = 'E:\Production DBs Backups\HOSPITAL_DB\HOSPITAL_DB_backup_2015_03_21_004001_6475144.trn' WITH NORECOVERY
RESTORE LOG archive_Test FROM DISK = 'E:\Production DBs Backups\HOSPITAL_DB\HOSPITAL_DB_backup_2015_03_21_010001_2411629.trn' WITH NORECOVERY
RESTORE LOG archive_Test FROM DISK = 'E:\Production DBs Backups\HOSPITAL_DB\HOSPITAL_DB_backup_2015_03_21_012001_8776987.trn' WITH NORECOVERY
RESTORE LOG archive_Test FROM DISK = 'E:\Production DBs Backups\HOSPITAL_DB\HOSPITAL_DB_backup_2015_03_21_014001_4470268.trn' WITH NORECOVERY
RESTORE LOG archive_Test FROM DISK = 'E:\Production DBs Backups\HOSPITAL_DB\HOSPITAL_DB_backup_2015_03_21_020001_0546277.trn' WITH NORECOVERY
RESTORE LOG archive_Test FROM DISK = 'E:\Production DBs Backups\HOSPITAL_DB\HOSPITAL_DB_backup_2015_03_21_022001_6839213.trn'



Thursday, March 5, 2015

sql server Compare Time Field between interval

declare @ts1 as time;
SELECT @ts1 = CAST('08:00:00 AM' AS TIME);

declare @ts2 as time;
SELECT @ts2 =CAST('12:00:00 PM' AS TIME);

select * from tasks.dbo.Tasks_PerHour_view
where jobtime between  CONVERT(time(0), @ts1) and CONVERT(time(0), @ts2)