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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -