Showing posts with label idea. Show all posts
Showing posts with label idea. Show all posts

Thursday, March 22, 2012

do anyone have an idea?

Hi there,

I have number of tasks in my control flow most of them are execute sql task. I want to update one of the column in my table when anyone of the task in the control get fails?

Please let me know if anyone have an idea how to do this.

Thanks and Regards

I think 'event handlers' can do that for you. I dont have specific examples now; but this forum has a lot of info on that.|||

Hi Salas,

You are right.I have done it by using event handler.

Thanks a lot.

Friday, March 9, 2012

Divide by Zero

When I specify a formula between Computed Column Specification, I have two
zero values, getting Divide by Zero error, any idea how can I avoid this? I
still want SQL Server to display Zero if it is 0/0, is this possible in SQL
Server database?
Thanks
J.CREATE TABLE #Test
(
col1 INT NOT NULL,
col2 INT NOT NULL
)
INSERT INTO #Test VALUES (50,0)
INSERT INTO #Test VALUES (20,10)
INSERT INTO #Test VALUES (0,0)
SELECT *,
CASE WHEN col1>0 AND col2>0 THEN col1/col2 ELSE 0 END FROM #Test
"Joriv" <nojunk@.please.com> wrote in message
news:dumr51$6id$1@.reader01.news.esat.net...
> When I specify a formula between Computed Column Specification, I have two
> zero values, getting Divide by Zero error, any idea how can I avoid this?
> I still want SQL Server to display Zero if it is 0/0, is this possible in
> SQL Server database?
> Thanks
> J.
>|||use case, here is an example
create table #test (value1 numeric (12,2),value2 numeric (12,2))
insert into #test
select 1,0 union all
select 1,0 union all
select 5,3 union all
select 4,2
select case value2 when 0 then 0 else value1/value2 end as SomeValue
from #test
http://sqlservercode.blogspot.com/|||Joriv,
Since 0/0 is not equal to zero, you need to make a different
calculation to get what you want. No programming language
should have a setting to display wrong answers (0 for the result of
0/0), so you have to be specific about what you want. One way
to do this in SQL is
CASE WHEN bottomValue = 0 THEN 0 ELSE topValue/bottomValue END
You don't say whether or not you also want a result of 0 if you have
1/0, 2/0 and so on. The example above will give you a result of 0
in these cases as well.
Steve Kass
Drew University
Joriv wrote:

>When I specify a formula between Computed Column Specification, I have two
>zero values, getting Divide by Zero error, any idea how can I avoid this? I
>still want SQL Server to display Zero if it is 0/0, is this possible in SQL
>Server database?
>Thanks
>J.
>
>|||Thanks Folks for all your responses, even I think I can use isnull,
but the idea is i want to use this Computed Column Spec in table designer,
how can I insert a formula which does this? even when i do this
isnull((table.column1/table.column2), 0), still does not work...getting same
error...any clue?
thanks
J.
"Joriv" <nojunk@.please.com> wrote in message
news:dumr51$6id$1@.reader01.news.esat.net...
> When I specify a formula between Computed Column Specification, I have two
> zero values, getting Divide by Zero error, any idea how can I avoid this?
> I still want SQL Server to display Zero if it is 0/0, is this possible in
> SQL Server database?
> Thanks
> J.
>|||Hi
CREATE TABLE #Test
(
col1 INT NOT NULL,
col2 INT NOT NULL,
col3 AS CASE WHEN col1>0 AND col2>0 THEN col1/col2 ELSE 0 END
)
INSERT INTO #Test VALUES (50,0)
INSERT INTO #Test VALUES (20,10)
INSERT INTO #Test VALUES (0,0)
SELECT * FROM #Test
"Joriv" <nojunk@.please.com> wrote in message
news:dumteu$7at$1@.reader01.news.esat.net...
> Thanks Folks for all your responses, even I think I can use isnull,
> but the idea is i want to use this Computed Column Spec in table designer,
> how can I insert a formula which does this? even when i do this
> isnull((table.column1/table.column2), 0), still does not work...getting
> same error...any clue?
> thanks
> J.
> "Joriv" <nojunk@.please.com> wrote in message
> news:dumr51$6id$1@.reader01.news.esat.net...
>|||Thanks for the group,
Now I run into another problem, once I set this formula successfully, I
cannot change the value programmatically. anyway I can do this?
Actually what I want to do this, Initally (default) I want to set to a
formula (say col1/col2) but I might change this programmatically in future
if required.
I tried to set this formual in the default/binding value, but I don't think
it likes any formual's over there.
Any ideas?
Thanks
J.
"Joriv" <nojunk@.please.com> wrote in message
news:dumr51$6id$1@.reader01.news.esat.net...
> When I specify a formula between Computed Column Specification, I have two
> zero values, getting Divide by Zero error, any idea how can I avoid this?
> I still want SQL Server to display Zero if it is 0/0, is this possible in
> SQL Server database?
> Thanks
> J.
>|||Here is the query without case/when.
e.g.
select isnull(a/nullif(b,0),0)[div]
from (select 1 a, 0 b
union all select 2,1)x
-oj
"Joriv" <nojunk@.please.com> wrote in message
news:dumteu$7at$1@.reader01.news.esat.net...
> Thanks Folks for all your responses, even I think I can use isnull,
> but the idea is i want to use this Computed Column Spec in table designer,
> how can I insert a formula which does this? even when i do this
> isnull((table.column1/table.column2), 0), still does not work...getting
> same error...any clue?
> thanks
> J.
> "Joriv" <nojunk@.please.com> wrote in message
> news:dumr51$6id$1@.reader01.news.esat.net...
>|||>> Actually what I want to do this, Initally (default) I want to set to a fo
rmula (say col1/col2) but I might change this programmatically in future if
required. <<
Then use VIEWs instead of a computed column, which is portable, which
can be drop and which allows you to have multiple formulas.
What answer did you want for 0/0? I would go with a NULL or catch the
error.

Divide by Zero

When I specify a formula between Computed Column Specification, I have two
zero values, getting Divide by Zero error, any idea how can I avoid this? I
still want SQL Server to display Zero if it is 0/0, is this possible in SQL
Server database?

Thanks
J.use case, here is an example

create table #test (value1 numeric (12,2),value2 numeric (12,2))
insert into #test
select 1,0 union all
select 1,0 union all
select 5,3 union all
select 4,2
select case value2 when 0 then 0 else value1/value2 end as SomeValue
from #test

http://sqlservercode.blogspot.com/|||IF like this:
Update a
Set X=column b/column c
where Column c<>0

Update a
Set X=0
where Column c=0

any help to you?|||Or perhaps something like:

Update a
Set X= case when columnc=0 then 0 else column b/column c end

MC

"yangyang" <loveflying000@.gmail.com> wrote in message
news:1141834929.055768.75450@.v46g2000cwv.googlegro ups.com...
> IF like this:
> Update a
> Set X=column b/column c
> where Column c<>0
> Update a
> Set X=0
> where Column c=0
> any help to you?

Saturday, February 25, 2012

Distribution of MSDE to 5,000 end users - good idea or bad?

Our company has an application that we distribute to our agents for generating sales quotes and it currently runs against an Access database. There is some interest in changing to MSDE and we're just trying to solicit some feedback from people that either investigated this or have tried it.

Here is our application and end user profile:

The application is a relatively small VB application that is distributed to about 5,000 agents. The data is stored in two separate physical database files (with many tables in each). One database stores the user-created data like prospects and configured options, and the other database stores the configuration options and rating data. The configuration option and rating data changes quarterly which is handled today through a new download of the software which overwrites the Access database that contains just that data. The agents are independent and sell for many companies, not just ours, and they own and use their own computer equipment. I would say they are probably at or below average for technical experience for end users. The proposal is to convert the application to run against an MSDE database and to include and install a copy of MSDE as part of the application installation. We would probably distribute service packs along with the quarterly updates, but agents do not always install the updates or could stop selling for us at any time, so there is no guarantee that the updates will ever be applied.

Dramatic overhauls of the application are not being considered at this time, and the users frequently do quotes while on-site with clients and they do not always have access to the Internet. In effect, while a web-based model may seem ideal, we would definitely lose sales if the agents are not able to quote with an off-line source of data and application, and the project is only evaluating whether or not it is a good idea to convert the database from Access to MSDE.

Thanks in advance for your comments!
ChrisYou've already pointed out the biggest issues. Service pack updates are a must. Beyond that, I would think this kind of situation lends itself to Access. I would think unless you plan on upgrading all of these machines to .NET, that it would be best to stick with the most distributable option of Access and the VB App.|||Should you decide to move this to .NET then an option might also be to just use XML for your data storage. If the amount of data is not very large, then Access or MSDE might actually be overkill. Deployment of XML based data is pretty straightforward too.