본문 바로가기

Get server side FileInfo 프로젝트 진행간에 아래와 같은 요구사항을 해결하기 위하여, 서버측의 FileInfo 가 필요하게 되었다. 요구사항 UpdateInform.htm 를 제공하는 페이지의 최근수정일을 확인하여, 유저가 최종 로그인한 시점과 비교하여, 로그인시점보다 나중인 경우, 페이지를 팝업으로 띄워 사용자에게 제공함. 구현 [WebMethod] public DateTime GetLastUpdateTime() { return new FileInfo(HttpContext.Current.Server.MapPath("~/UpdateInform.htm")).LastWriteTime; } .이런 저런 삽질 후에 알아냈으나, 일단은 서비스 구현부터 하고 파봐야 겠다. 더보기
How to find DB Size Storage 의 사이즈를 확인하기 위해서 아래의 Query 를 사용합니다. USE DBName GO SELECT [size] * 8 , [filename] FROM sysfiles sysfiles 라는 view 는 기본적으로 system 에서 제공하는 것으로써 storage 에 대한 정보를 갖고 있습니다. 이 중 size 컬럼은 그 크기를 8 KB 페이지 단위로 나타내고 있기 때문에, 실제의 용량을 확인하기 위해서는 8 을 곱하면 됩니다. 출처: http://stackoverflow.com/questions/176379/determine-sql-server-database-size 더보기
SQL Server DateTime Formatting SQL Server DateTime FormattingUsually the formatting of a DateTime value into a more readable date and time is dealt with by the client application. However, there are some situations were it is useful to convert a DateTime into a formatted character string within a SQL statement. Converting a DateTime to a VarCharThe Transact-SQL (T-SQL) Convert command can be used to convert data between diffe.. 더보기