Popular Posts
Word break tag : <wbr/> (HTML5) The  HTML  <wbr>  tag  is  used  defines  a  potential  line  break  point  if  needed.  This  stands  for  Word  BReak. This  is  u... CTE, recursive search WITH DepartmentSearch(DeptID, DeptParent, DeptName, OuID) AS (     -- 找出簽核者所屬部門     SELECT d.DeptID, d.DeptParent, d.DeptName, d.OuID     FR... Create web service client cross SSL with eclipse When creating web service cross SSL using eclipse, it occuss some error like below: And it can't build the client source from this wa...
Stats
Detect column exist
Sql server:
-- Add new column if column not exists
IF NOT EXISTS(SELECT * FROM sys.columns WHERE Name = N'ColumnName' AND Object_ID = Object_ID(N'TableName'))
ALTER TABLE [TableName] ADD [ColumnName] VARCHAR(200)


-- Modify column name if new column not exists
IF NOT EXISTS(SELECT * FROM sys.columns WHERE Name = N'NewColumnName' AND Object_ID = Object_ID(N'TableName'))
EXECUTE sp_rename N'TableName.OldColumnName', N'NewColumnName', 'COLUMN'