MSSQL

How to alter column with default constraint in MSSQL

SQL_icon_base.jpgWhen you try alter column in MSSQL 2005 from one datatype to other with some default value by ALTER TABLE xxx ALTER COLUMN column_name you get error about existing constraint. Unfortunately there is nothing like CASCADE CONSTRAINT. You must DROP constraint first and then you can ALTER column and finally you have to create CONSTRAINT again. I will show you easy way, how to do it.

How to use a variable inside SQL in SSIS Data Flow Tasks

2-sql-servers.png

Sometimes you need to use a variable inside SQL in SSIS Data Flow Tasks. For example, you may want to select TOP x records in a periodically scheduled task. This X variable could be used to adjust performance or sometimes a condition cannot be specified when the package is created. And of course there are many other reasons for why you would want to use a variable in Data Flow Tasks. The problem is that, although you can put "?" in your SQL query for the DB source, you cannot set up the parameters there by clicking a button. And you will get an error message if you try to use this query. But there are ways to accomplish the same thing. In this article I will show you how to do it using Script Task.


Solved - Retrieving the COM class factory for component with CLSID in SSIS

SQL_icon_base.jpg I get strange error during redeveloping one SSIS. When I tried run some SQL task, finally such an easy one with "SELECT 1", I always received same error.

[Execute SQL Task] Error: Executing the query "" failed with the following error: "Retrieving the COM class factory for component with CLSID {7816B7A3-CD60-4539-BD38-C35AFC61F200} failed due to the following error: 80040154.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. 

 



How to drop column with default constraint

SQL_icon_base.jpgWhen you try drop column in MSSQL 2005 with some default value by ALTER TABLE xxx DROP column_name you get error about existing constraint. Unfortunately there is nothing like CASCADE CONSTRAINT. You must DROP constraint first and then you can DROP column. I will show you the easiest way, how to do it.
 

Subcategories