SQL Server essence

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2009年7月8日

摘要: osql.exe -S %TARGETSERVER% -E -d Northwind -Q"select db_id()" > nulif %errorlevel% == 0 ( @echo. @echo Northwind DB already exists. @echo. goto end)@echo.@echo Creating Northwind DB ...@echo.osql.e... 阅读全文
posted @ 2009-07-08 18:43 天蝎 阅读(129) 评论(0) 推荐(0) 编辑

摘要: 'CString' to 'std::string':std::string cannot always construct from a LPCTSTR i.e. the code will fail for UNICODE builds.So the following conversion will lead to error:CString cs("Hello");std::string ... 阅读全文
posted @ 2009-07-08 14:38 天蝎 阅读(581) 评论(0) 推荐(0) 编辑

摘要: Original link: http://www.codeguru.com/forum/showthread.php?t=436716A: An easy way is to use FindFirstChangeNotification, FindNextChangeNotification and one of the wait functions in a worker thread. A... 阅读全文
posted @ 2009-07-08 13:33 天蝎 阅读(395) 评论(0) 推荐(0) 编辑

摘要: 1. #ifndef HEADER_BASE_HPP#define HEADER_BASE_HPP class base_class{ // some code};#endif // HEADER_BASE_HPPThe first line checks whether we have not yet defined 'HEADER_BASE_HPP'. If we have not, then... 阅读全文
posted @ 2009-07-08 12:20 天蝎 阅读(173) 评论(0) 推荐(0) 编辑

摘要: 在Windows的shellapi文件中定义了一个名为SHFileOperation()的外壳函数,用它可以实现各种文件操作,如文件的拷贝、删除、移动等,该函数使用起来非常简单,它只有一个指向SHFILEOPSTRUCT结构的参数。使用SHFileOperation()函数时只要填写该专用结构--SHFILEOPSTRUCT,告诉Windows执行什么样的操作,以及其它重要信息就行了。SHFile... 阅读全文
posted @ 2009-07-08 12:03 天蝎 阅读(1471) 评论(0) 推荐(0) 编辑

2009年7月7日

摘要: Original link: http://www.codeguru.com/forum/showthread.php?t=269905Q: Why does program work in debug mode, but fail in release mode?A: First of all, there is no such thing as 'debug mode' or 'release... 阅读全文
posted @ 2009-07-07 18:52 天蝎 阅读(381) 评论(0) 推荐(0) 编辑

2009年6月26日

摘要: Original link: http://www.sqlservercentral.com/scripts/63782/This has been tested on SQL 2000, 7 and 2005 databases very successfully. 40 GB went down to under 1 GB, 176GB went down to 105MB/*Shrink a... 阅读全文
posted @ 2009-06-26 19:00 天蝎 阅读(583) 评论(0) 推荐(0) 编辑

摘要: create proc sp_default_collation as set nocount on declare @servercollation sysname select @servercollation = convert(sysname, serverproperty('collation')) if @servercollation is not NULL BEGIN sele... 阅读全文
posted @ 2009-06-26 18:19 天蝎 阅读(272) 评论(0) 推荐(0) 编辑

2009年4月27日

摘要: Using xp_fixeddrives to Monitor Free Space By Gregory A. Larsen As a DBA one of your responsibilities is to monitor disk space. You always need to make sure you have enough for your databases, databa... 阅读全文
posted @ 2009-04-27 14:43 天蝎 阅读(563) 评论(0) 推荐(0) 编辑

2009年4月22日

摘要: SQL Server 2005 新增 cross apply 和 outer apply 联接语句,增加这两个东东有啥作用呢? 我们知道有个 SQL Server 2000 中有个 cross join 是用于交叉联接的。实际上增加 cross apply 和 outer apply 是用于交叉联接表值函数(返回表结果集的函数)的,更重要的是这个函数的参数是另一个表中的字段。这个解释可能有些含... 阅读全文
posted @ 2009-04-22 18:50 天蝎 阅读(1326) 评论(1) 推荐(0) 编辑