A Journey 2 Eternity

Archive for November 2011

We can deprecate a method, property, or even an entire class in C++ Builder, using the [[deprecated]] attribute. Deprecating an entity is a way of signalling to other developers that it should no longer be used, typically because there is another – more preferable – way of doing things.

When a deprecated entity is used in code, a compiler warning will be issued.

enum StatModelsType [[deprecated("Use StatisticalModelType instead.")]] {
smtNone = 0,
smtScanModel,
smtExFactoryModel,
smtOptimiserModel
};
DECLARE @Date datetime
SET @Date = '2011/11/16'
SELECT  DATEADD(dd,-(DATEPART(dw, @Date) - 1),@Date) AS 'First day of the week',
DATEADD(dd,-(DATEPART(dw, @Date) - 7),@Date) AS 'Last day of the week',
DAY(DATEADD(d, -DAY(DATEADD(m,1,@Date)),DATEADD(m,1,@Date))) AS 'Total day of the month'
Tags: ,

The following query retrieving the table column details.

SELECT COLUMN_NAME [Field],DATA_TYPE + '(' + ISNULL(CONVERT(NVARCHAR,CHARACTER_MAXIMUM_LENGTH),'') + ')' + '    ' + CASE WHEN IS_NULLABLE = 'NO' THEN 'NOT ' ELSE '' END + 'NULL' [Type] 
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE TABLE_NAME = 'account' 
ORDER BY ORDINAL_POSITION ASC
Tags: ,

Pages

Categories

November 2011
M T W T F S S
« Jun   Dec »
 123456
78910111213
14151617181920
21222324252627
282930  

Blog Stats

  • 27,261 hits