Read this if you want to read more about instant file initialization (IFI). In an earlier blog post, I posted a script that uses trace flags, created a dummy-database and then sp_readerrorlog to check for IFI.
Another option is to use the OS command whoami, as documented here. Below script uses whoami to check for IFI, or more precisely SQL Server having the “Perform Volume Maintenance Tasks” policy. It uses xp_cmdshell, meaning you have to be sysadmin in order to use it.
IF OBJECT_ID('tempdb..#res') IS NOT NULL DROP TABLE #res
SET NOCOUNT ON
GO
DECLARE
@was_xp_cmd_on tinyint
,@was_show_adv_on tinyint
,@is_ifi_enabled tinyint
--Exit if we aren't sysadmin
IF IS_SRVROLEMEMBER('sysadmin') <> 1
BEGIN
RAISERROR('You must be sysadmin to execute this script', 16, 1)
RETURN
END
--Save state for show advanced options
SET @was_show_adv_on =
(
SELECT CAST(value_in_use AS tinyint)
FROM sys.configurations
WHERE name = 'show advanced options'
)
--Turn on show advanced options, if neccesary
IF @was_show_adv_on = 0
BEGIN
EXEC sp_configure 'show advanced options', 1
RECONFIGURE
END
--Save state for xp_cmdshell
SET @was_xp_cmd_on =
(
SELECT CAST(value_in_use AS tinyint)
FROM sys.configurations
WHERE name = 'xp_cmdshell'
)
--Turn on xp_cmdshell, if neccesary
IF @was_xp_cmd_on = 0
BEGIN
EXEC sp_configure 'xp_cmdshell', 1
RECONFIGURE
END
CREATE TABLE #res (col VARCHAR(255))
INSERT INTO #res(col)
EXEC xp_cmdshell 'whoami /priv /nh'
SET @is_ifi_enabled =
(
SELECT CASE WHEN PATINDEX('%Enabled%', col) > 0 THEN 1 ELSE 0 END
FROM #res
WHERE col LIKE '%SeManageVolumePrivilege%'
)
IF @is_ifi_enabled = 1
SELECT 'Instant file initialization is enabled'
ELSE
SELECT 'Instant file initialization is NOT enabled'
--Reset state for xp_cmdshell
IF @was_xp_cmd_on = 0
BEGIN
EXEC sp_configure 'xp_cmdshell', 0
RECONFIGURE
END
--Reset state for show advanced options
IF @was_show_adv_on = 0
BEGIN
EXEC sp_configure 'show advanced options', 0
RECONFIGURE
END
Dangnhapbj88 is offering some cool promotions right now. Definitely worth a look if you’re trying to maximize your winnings. Sign me up with dangnhapbj88.
Heard some buzz about 123winonline. Claim they have some good promos going on. Worth checking out to see if you can snag a sweet bonus. Find your win at 123winonline
What’s up! Just wanted to say hi888win is actually pretty good. I was looking for a reliable site and found it. Fast payouts too. Get your game on at hi888win.
Alright, alright, alright… checking out bong88wiki. Seems like a solid place to get my bearings. Hoping to find some insider knowledge here, know what I mean? Good luck to everyone!
AAAbet1, had a gander. Not bad, pretty straightforward. Thinking about placing a bet or two. Check ’em out at aaabet1.
Just cruised through et365. Looks like a decent spot for sports betting. I’m tempted to place a wager on the game tonight. Check it out at et365.
Lotogreenlogin? I’ve logged in a few times. Seems like a decent platform for lottery stuff, pretty easy to use overall. lotogreenlogin
Shbet.80, I like it! Payouts are quick, the games are fun, Customer support seems decent too. Nice work. shbet.80
Been hearing buzz about ’88 go’. Seems like a new player in the scene. Anyone got some insider info? Always on the lookout for fresh opportunities to enjoy. 88 go
188win8 got me here and It’s alright. Solid platform, decent odds. Nothing groundbreaking, but reliable. Give it a try if you’re looking for something dependable. 188win8 for life.