SQL icon baseIf you need calculate week number from date, you can use DATEPART with parameter ISO_WEEK. Unfortunately there is nothing like ISO YEAR parameter. In case you need to show YearWeek value in some report you have to take care about correct value manually.

SQL_icon_base.jpgAre you looking for simple way, how to get count of distinct values for each column in a table on MS-SQL database? There is a simple script with solution to help you.

2-sql-servers3 most often reason, when you are using variables in Execute SQL task inside SSIS and get following error:

Error: 0xC002F210 ... , Execute SQL Task: Executing the query "...

..." failed with the following error: "HERE IS IMPORTANT PART". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.


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.


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.