SqlServer Internal Error dm_os_enumerate_filesystem -- alloc\storagedmv.cpp - sql-server

I recently started using sys.dm_os_enumerate_filesystem.
My SQL Server version is:
(Microsoft SQL Server 2017 (RTM-CU31) (KB5016884) - 14.0.3456.2 (X64) Sep 2 2022 11:01:50 Copyright (C) 2017 Microsoft Corporation Developer Edition (64-bit) on Windows Server 2012 Standard 6.2 (Build 9200: ) (Hypervisor) )
Everything worked fine until I started querying filesystems where the directories are very large.
The following query generated the error:
SELECT *
from sys.dm_os_enumerate_filesystem('F:\technician','*');
Msg 407, Level 16, State 1, Line 15
internal error. The string routine in file sql\ntdbms\storeng\dfs\alloc\storagedmv.cpp, line 799 failed with HRESULT 0x8007007a.
The directory is 460 GB. I have also checked all permission and SQL Server service has all permission on the above directory.
As you can see the SqlServer is running with the last CU31.
Is there a workaround?

Related

How to know who has updated the table in SQL server?

I want to know who has modified the table in the SQL server, But I couldn't find any authentic solution for this.
I tried function fn_dblog, but it is not allowing me due to some permission issue.
SELECT * FROM fn_dblog(NULL, NULL)
Error Message:
Msg 229, Level 14, State 5, Line 1 The SELECT permission was denied on
the object 'fn_dblog', database 'mssqlsystemresource', schema 'sys'.
I refereed this article, but the link for the fndblog2 function expired.
Basically, I want to get the list of users who have updated the given table, if it is modified in SSMS then user details and if it is modified by some .net application then .net application name.
SSMS details: Microsoft SQL Server 2019 (RTM-CU10) (KB5001090) - 15.0.4123.1 (X64) Mar 22 2021 18:10:24 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Windows Server 2019 Datacenter 10.0 (Build 17763: ) (Hypervisor)
Note: Privelleged Permission can't be given to me due to securities issues. I am fine with writing a C# application. I am ok with writing C# appication if it is possible in C#.

Enable File Stream SQL Server 2017

I am trying to enable file stream on Microsoft SQL Server 2017, on a Windows Core 2019 Server.
I have changed the registry settings at the following location to enable it as there is no GUI. I set the value to 3
ServerName\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL14.InstanceName\MSSQLServer\Filestream.EnabledLevel
After This I restarted
I have also installed the latest Cumulative update (20) as I know there where issues with Driver signing.
After This I restarted
I am seeting the following Errors in the log file at C:\Program Files\Microsoft SQL Server\MSSQL14.InstanceName\MSSQL\Log
<{781FAE78-09AB-4EE5-B051-67747BDB19E3}>RsFxMgmtInitialize failed (the RsFx device is not found. Check if RsFx driver is started.): Error 0x80070002 (-2147024894)
2020-04-21 08:56:03.94 spid5s FILESTREAM: failed to connect to kernel driver RsFx0503.
<{1038F43D-3391-45F7-B1B3-BADF26459429}>Failed to initialize CFsaShareFilter: Error 0x80070002 (-2147024894)
<{1038F43D-3391-45F7-B1B3-BADF26459429}>Failed to initialize CFsaShareFilter: Error 0x80070002 (-2147024894)
2020-04-21 08:56:03.94 spid5s FILESTREAM: effective level = 0, configured level = 2.
2020-04-21 08:56:03.94 spid5s FILESTREAM feature could not be initialized. The operating system Administrator must enable FILESTREAM on the instance using Configuration Manager.
SELECT ##VERSION
Microsoft SQL Server 2017 (RTM-CU20) (KB4541283) - 14.0.3294.2 (X64) Mar 13 2020 14:53:45 Copyright (C) 2017 Microsoft Corporation Standard Edition (64-bit) on Windows Server 2019 Standard 10.0 <X64> (Build 17763: ) (Hypervisor)
I got this working on one server and cannot get it working on the second one.
There is also a version of sql 2019 on this box
Any help? Also any advice on getting this working on a cluster
I used "computer management" and remotly connect to your core server. From there, you can enable FileStream and configure it.
This seemed to work better that the registry method

Importing into SQL Server directly from Zipped File

I have a simple 4 column text file with billions of rows (say Huge_file.txt ). Now the Huge_File.txt after compressing is around 1 TB in zipped format with around 11 % compression rate ( after unzipping the size will balloon upto 10 TB or so.)
Is there a way to load Huge_File.txt without unzipping?(Space issues on server.) Like something similar to how Redshift imports a zipped file from S3 without unzipping it.
P.S. I am using SQL Server
Version : Microsoft SQL Server 2016 (SP1) (KB3182545) - 13.0.4001.0 (X64)
Oct 28 2016 18:17:30
Copyright (c) Microsoft Corporation
Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2016 Standard 6.3 (Build 14393: )
Any help is appreciated. Thank you.

"The column is too long in the data file" while doing bulk insert from native data file

I'm trying to copy all data in a table to another SQL server's identical empty table. I'm using a transfer file cause direct SQL-connection is not possible. For some reason the insert fails with this single table. I've used it successfully with many other tables. Any ideas what causes the issue or how to overcome it?
Source: Microsoft SQL Server 2008 R2 (SP2) - 10.50.4321.0 (X64)
Jul 9 2014 15:59:57
Copyright (c) Microsoft Corporation
Standard Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1) (Hypervisor)
Target: Microsoft SQL Server 2014 - 12.0.4100.1 (X64)
Apr 20 2015 17:29:27
Copyright (c) Microsoft Corporation
Standard Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1) (Hypervisor)
Exported using command-line:
bcp myDB.dbo.f_myTable out f_myTable -n -S 123.123.123.123 -U myUsername -P %passwd%
Tried importing using T-SQL:
BULK INSERT dbo.f_myTable FROM 'C:\f_myTable' WITH (DATAFILETYPE='native',keepidentity);
Resulted in error:
Msg 4866, Level 16, State 4, Line 70
The bulk load failed. The column is too long in the data file for row 1, column 13. Verify that the field terminator and row terminator
are specified correctly.
Msg 7399, Level 16, State 1, Line 70
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 70
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".
Here's what I've tried already with no luck:
Recreating the table in source using the script from source.
Played with import options: KEEPIDENTITY, BATCHSIZE, MAXERRORS, KEEPNULLS
Exported using the server's command line in addition to my local PC

Can't Restore Azure SQL V12 bacpac to a local SQL 2014 server

Since we upgraded some of our Azure SQL servers to V12, we can no longer restore a bacpac locally using command line sqlpackage.exe. We also tried using Management Studio, but no dice.
Our local developer machines are running:
Microsoft SQL Server 2014 - 12.0.4213.0 (X64)
Jun 9 2015 12:06:16
Copyright (c) Microsoft Corporation
Developer Edition (64-bit) on Windows NT 6.3 (Build 9600: )
Here is the error we encounter:
*** Error importing database:Could not import package.
Error SQL72014: .Net SqlClient Data Provider: Msg 33233, Level 16, State 1, Line
1 You can only create a user with a password in a contained database.
Error SQL72045: Script execution error....
This looks like it is having issues creating the users that were added by scripts.
Is anyone else running into this issue?
Update:
Apparently this has been a reported problem since April. https://social.msdn.microsoft.com/Forums/sqlserver/en-US/85bb12e8-5ae4-409c-93fa-8a9d025c6b35/error-when-importing-a-datatiers-application-from-azure-db-as-contained?forum=ssdt
The work around from the above post works. You need to modify the bacpac file and create a new checksum: http://inworksllc.com/editing-sql-database-azure-bacpac-files/
This is a workaround, not a fix.
Update: Looks like there will be a fix soon.

Resources