Showing posts with label containing. Show all posts
Showing posts with label containing. Show all posts

Tuesday, March 27, 2012

Able to run packages outside Designer, but not one containing FTP task

Hi. I have read most of the threads on not being able to run packages outside the Designer, in Agent. I believe my problem is different:

I am able to run some packages with Agent. In fact, we have a couple scheduled and running every night.

However, when we try to run a package that contains an FTP task it only runs in debug mode. If we import it into our server or run it without debugging it keeps failing and giving us the now famous:

The task...... cannot run on this edition of Integration Services. It requires a higher level edition.

So, we have some packages already scheduled and running, but we can't run this specific package with the FTP task. We (two of us) have created this package in the same way we created the other ones. We have created different versions to see if one gets a hit, with no success.

Any thoughts would be greately appreciated.

Ricardo

Do you have SSIS installed on this machine (check if you have SSIS Service installed)?|||

Michael, thanks for replying.

I and a co-worker have local machines on which we design all the packages. When they run fine in debug mode we import them into a server dedicated to SQL Server 2005 and all tools/services. It contains the databases, Integration Services, Reporting Services, etc.

We have created and scheduled several packages to run over night or over the weekend. The only one that is giving us problems is this FTP package. It would work fine in debug mode. We would import it into the server and it would fail. Based on something I found in another thread I ran it on my local machine without debugging and it failed. This is the only package that fails when not in debug mode; all the other packages run fine in both modes: debug and not debug.

I assume that if we didn't have SSIS installed none of the packages would run, but we are fairly new at this.

Is the FTP task/process maybe special in some way or have a special set of requirements?

Any further help would be greatly appreciated.

|||When you run the package with FTP task on server, where you have SSIS installed - what error do you get? The problem why it fails on server is probably different than the problem why it fails on workstation in non-debug. For more details on second issue, see
http://blogs.msdn.com/michen/archive/2006/11/11/ssis-product-level-is-insufficient.aspx

Thursday, March 8, 2012

A simple (?) SQL query for someone clever

Unfortunately I can't use the excuse of being a SQL newbie, but drawn a
blank on the following "simple" problem.
I have a table containing the following (extract) :

+--+----+----+---+
| id | fk_MainID | fk_GroupID | Visible |
+--+----+----+---+
| 4 | 158 | 1 | 1 |
| 3 | 148 | 1 | 1 |
| 5 | 150 | 1 | 1 |
| 6 | 146 | 1 | 1 |
| 7 | 127 | 1 | 1 |
| 8 | 125 | 1 | 1 |
| 9 | 117 | 1 | 1 |
| 10 | 119 | 1 | 1 |
| 11 | 128 | 1 | 1 |
| 12 | 118 | 1 | 1 |
| 13 | 105 | 1 | 1 |
| 14 | 99 | 1 | 1 |
| 15 | 102 | 1 | 1 |
| 16 | 153 | 1 | 1 |
| 17 | 157 | 1 | 1 |
| 18 | 152 | 1 | 1 |
| 19 | 149 | 1 | 1 |
| 28 | 162 | 10 | 0 |
| 25 | 160 | 1 | 1 |
| 27 | 162 | 1 | 1 |
| 26 | 160 | 10 | 0 |
| 29 | 151 | 1 | 1 |
+--+----+----+---+

I need to find the "fk_MainID" where there is a "Visible=1" value, but NOT a
"Visible=0".
For example:
SELECT fk_MainID FROM GRP WHERE Visible=1
is no good because it will select fk_MainID=162, which also has a Visible=0
row.
I can do it with a sub-select, eg.
SELECT fk_MainID FROM GRP WHERE fk_MainID NOT IN (SELECT fk_MainID FROM GRP
WHERE Visible=0)
but unfortunately the query has to be "cross platform" at least to the
extent that it will also work on MySQL, which doesn't support sub-selects in
the release 3.x versions.

Very grateful in advance for any help.
ThanksAssuming that Visible is not nullable and contains only the values 0 and 1:

SELECT fk_mainid
FROM GRP
GROUP BY fk_mainid
HAVING MIN(visible)=1

--
David Portas
----
Please reply only to the newsgroup
--|||David,
You are a very clever man and your beer is in the mail.
I was trying all combinations of WHERE conditions, and never considered this
approach.
Thanks

> Assuming that Visible is not nullable and contains only the values 0 and
1:
> SELECT fk_mainid
> FROM GRP
> GROUP BY fk_mainid
> HAVING MIN(visible)=1
> --
> David Portas
> ----
> Please reply only to the newsgroup
> --

A simple (?) SQL query for someone clever

Unfortunately I can't use the excuse of being a SQL newbie, but drawn a
blank on the following "simple" problem.
I have a table containing the following (extract) :
+--+--+--+--+
| id | fk_MainID | fk_GroupID | Visible |
+--+--+--+--+
| 4 | 158 | 1 | 1 |
| 3 | 148 | 1 | 1 |
| 5 | 150 | 1 | 1 |
| 6 | 146 | 1 | 1 |
| 7 | 127 | 1 | 1 |
| 8 | 125 | 1 | 1 |
| 9 | 117 | 1 | 1 |
| 10 | 119 | 1 | 1 |
| 11 | 128 | 1 | 1 |
| 12 | 118 | 1 | 1 |
| 13 | 105 | 1 | 1 |
| 14 | 99 | 1 | 1 |
| 15 | 102 | 1 | 1 |
| 16 | 153 | 1 | 1 |
| 17 | 157 | 1 | 1 |
| 18 | 152 | 1 | 1 |
| 19 | 149 | 1 | 1 |
| 28 | 162 | 10 | 0 |
| 25 | 160 | 1 | 1 |
| 27 | 162 | 1 | 1 |
| 26 | 160 | 10 | 0 |
| 29 | 151 | 1 | 1 |
+--+--+--+--+
I need to find the "fk_MainID" where there is a "Visible=1" value, but NOT a
"Visible=0".
For example:
SELECT fk_MainID FROM GRP WHERE Visible=1
is no good because it will select fk_MainID=162, which also has a Visible=0
row.
I can do it with a sub-select, eg.
SELECT fk_MainID FROM GRP WHERE fk_MainID NOT IN (SELECT fk_MainID FROM GRP
WHERE Visible=0)
but unfortunately the query has to be "cross platform" at least to the
extent that it will also work on MySQL, which doesn't support sub-selects in
the release 3.x versions.
Very grateful in advance for any help.
ThanksAssuming that Visible is not nullable and contains only the values 0 and 1:
SELECT fk_mainid
FROM GRP
GROUP BY fk_mainid
HAVING MIN(visible)=1
--
David Portas
--
Please reply only to the newsgroup
--|||David,
You are a very clever man and your beer is in the mail.
I was trying all combinations of WHERE conditions, and never considered this
approach.
Thanks
> Assuming that Visible is not nullable and contains only the values 0 and
1:
> SELECT fk_mainid
> FROM GRP
> GROUP BY fk_mainid
> HAVING MIN(visible)=1
> --
> David Portas
> --
> Please reply only to the newsgroup
> --
>

Saturday, February 11, 2012

A good way to increment field value

Hi

I have a field containing numbers. I want to do some simple arithmetics with it, say value=value+1 or value=value-1 or or even value+2. What is to be done, is fixed at design time. I think this could be done by loading the row or record to my program and doing the calculations there. And then storing the record back. But this seems too complicated.

Is there a single query doing that in data table.

You can create all your calculation in an sql server user defined function.

And call this function while inserting the data into a table.

|||

Thanks. That seems interesting. And while searching for user defined functions I found help to other problem as well.

I found this:

create function getfulldate (@.date varchar(10))
returns datetime
as
begin
declare @.getfulldate datetime
set @.getfulldate = dateadd (mi,55,@.date)
return @.getfulldate
end

and normally we call this in the SQL statements as
select *, dbo.getfulldate('2006-05-03') from emp

If I undestand this right, this goes into code. Do you know how to put udf in sql server. Or rather, where to start learning it.

Regards

Leif

|||

I found a tutorial about T-sql.