UFN_MKTCOMMON_COLUMNEXISTS
Returns whether or not the specified column exists on the specified table.
Return
| Return Type |
|---|
| bit |
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @TABLENAME | nvarchar(128) | IN | |
| @COLUMNNAME | nvarchar(128) | IN |
Definition
Copy
create function dbo.[UFN_MKTCOMMON_COLUMNEXISTS]
(
@TABLENAME nvarchar(128),
@COLUMNNAME nvarchar(128)
)
returns bit
as
begin
return (case when exists(select 1 from [INFORMATION_SCHEMA].[COLUMNS] where [TABLE_SCHEMA] = 'dbo' and [TABLE_NAME] = @TABLENAME and [COLUMN_NAME] = @COLUMNNAME) then 1 else 0 end);
end