PDA

View Full Version : سوال: آیا راهی برای بدست آوردن تاریخ ایجاد یک فایل با استفاده از دستورات SQL هست؟



zhr.rezae66i
شنبه 14 اردیبهشت 1392, 08:25 صبح
آیا راهی برای بدست آوردن تاریخ ایجاد یک فایل با استفاده از دستورات SQL هست؟
ممنون از راهنمایی هاتون

mahdy.asia
شنبه 14 اردیبهشت 1392, 09:19 صبح
فکر می کنم از تابع زیر بتونید استفاده کیند

EXEC xp_cmdshell 'dir *.exe';
با استفاده از این تابع دستورات cmd که می تونه مشخصات فایل باشه رو می تونید در اسکیوال اجرا کنید

zhr.rezae66i
شنبه 14 اردیبهشت 1392, 09:28 صبح
میبخشید مسیر رو کجا باید بزارم؟

تازه این پروسجر هم بلاکه، نمیشه ازش استفاده کرد
خطا
SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. For more information about enabling 'xp_cmdshell', search for 'xp_cmdshell' in SQL Server Books Online.

hesamsalehnamadi
شنبه 14 اردیبهشت 1392, 09:39 صبح
https://www.simple-talk.com/sql/t-sql-programming/the-tsql-of-text-files/

mahdy.asia
شنبه 21 اردیبهشت 1392, 08:35 صبح
میبخشید مسیر رو کجا باید بزارم؟

تازه این پروسجر هم بلاکه، نمیشه ازش استفاده کرد
خطا
SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. For more information about enabling 'xp_cmdshell', search for 'xp_cmdshell' in SQL Server Books Online.

-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO