How could I remove sql server's table .mdf file's file_attribute_compressed attributes using C++ API function? -


how remove sql server's table .mdf file's file_attribute_compressed attributes using c++ api functions these table .mdf file not in compressed mode(blue color file). therefore, sql server read/write these tables correctly. found if file of sql server folder "data" become blue(which compressed), program running sql server file pop messagebox of "the file mdf compressed not reside in read-only database or filegroup. file must decompressed."

i tried find solution on website , find 1 c++ api function call "setfileattributes", , tried way of adding or removing file_attribute_compressed not effective .mdf file not change color white blue or blue white.

could please suggestion kind of effective c++ api function call can remove compress mode of these .mdf or .ldf file , sql server running without these above messagebox? thank help? running environment: sql server 2005 on windows xp

code:

cstring szfilepath = "e:\\db.mdf";  dword dwfileattributes = getfileattributes(szfilepath);  if ((dwfileattributes & file_attribute_compressed) == 0)  {      setfileattributes(szfilepath, dwfileattributes | file_attribute_compressed);      return;  }  if ((dwfileattributes & file_attribute_compressed) == file_attribute_compressed)  {      setfileattributes(szfilepath, dwfileattributes & ~file_attribute_compressed);      return;  } 


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -