Showing posts with label implement. Show all posts
Showing posts with label implement. Show all posts

Sunday, March 11, 2012

Division query

i have an equation which i have to implement in query:
availa= (1-[return0]/sum(r1+r2+r3+r4+r5))
when tried the query i get avail as zero always, help me outNAVIN.D skrev:

> i have an equation which i have to implement in query:
> availa= (1-[return0]/sum(r1+r2+r3+r4+r5))
> when tried the query i get avail as zero always, help me out
Without knowing what the above equation is or where it is used the easy
explanation would be that it's caused by integer division, ie.
everything below 1.0 will become 0.
/impslayer, aka Birger Johansson|||You will get an integer result when all operands are integer. You can
specify a decimal operand if you need decimal result. The result will
decimal in that case because the decimal data type has a higher precedence
than integer. Try:
availa = (1.0-[return0]/sum(r1+r2+r3+r4+r5))
Hope this helps.
Dan Guzman
SQL Server MVP
"NAVIN.D" <NAVIND@.discussions.microsoft.com> wrote in message
news:48C5F07C-1023-4AB1-9B17-356321EB95CD@.microsoft.com...
> i have an equation which i have to implement in query:
> availa= (1-[return0]/sum(r1+r2+r3+r4+r5))
> when tried the query i get avail as zero always, help me out|||If SUM(r1+r2+r3+r4+r5) > (1-[return0]), you will get zero because SQL will
return a value within the datatype integer. (The answer will be truncated).
Try
(1.00 - [return0]/sum(r1+r2+r3+r4+r5)
"NAVIN.D" wrote:

> i have an equation which i have to implement in query:
> availa= (1-[return0]/sum(r1+r2+r3+r4+r5))
> when tried the query i get avail as zero always, help me out|||thank you mark and imsplayer it was decimal and integer funda only i got it
immd after posting anyways thanks for the reply
"Mark Williams" wrote:
> If SUM(r1+r2+r3+r4+r5) > (1-[return0]), you will get zero because SQL will
> return a value within the datatype integer. (The answer will be truncated)
.
> Try
> (1.00 - [return0]/sum(r1+r2+r3+r4+r5)
>
> --
>
> "NAVIN.D" wrote:
>

Friday, February 24, 2012

Distribution agent insufficient permissions

Hi,

I am trying implement replication and having problem when creating push subscription to an existing transactional replication publication.
The distribution agent is failing to run its job with the error:

Agent message code 14260. You do not have sufficient permission to run this command. Contact your system administrator.

I followed the http://msdn2.microsoft.com/en-us/library/ms151868.aspx article instructions when I set the distribution agent properties

What did I miss?

The following is the step error message:
Date 1/12/2007 2:30:01 PM
Log Job History (105342-DB3\PROD-MOMA-ArchivedTransactions-105337-DEV2-15)

Step ID 2
Server 105342-DB3\PROD
Job Name 105342-DB3\PROD-MOMA-ArchivedTransactions-105337-DEV2-15
Step Name Run agent.
Duration 00:00:00
Sql Severity 0
Sql Message ID 0
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0

Message
2007-01-12 19:30:01.258 Microsoft SQL Server Replication Agent: distrib
2007-01-12 19:30:01.258
2007-01-12 19:30:01.258 The timestamps prepended to the output lines are expressed in terms of UTC time.
2007-01-12 19:30:01.258 User-specified agent parameter values:
-Subscriber 105337-DEV2
-SubscriberDB MOMA
-Publisher 105342-DB3\PROD
-Distributor 105342-DB3\PROD
-DistributorSecurityMode 1
-Publication ArchivedTransactions
-PublisherDB MOMA
-XJOBID 0x65C41EBC553D96439BAF69E4DC3CC823
-XJOBNAME 105342-DB3\PROD-MOMA-ArchivedTransactions-105337-DEV2-15
-XSTEPID 2
-XSUBSYSTEM Distribution
-XSERVER 105342-DB3\PROD
-XCMDLINE 0
-XCancelEventHandle 00000000000006E8
2007-01-12 19:30:01.258 Startup Delay: 214 (msecs)
2007-01-12 19:30:01.477 Connecting to Distributor '105342-DB3\PROD'
2007-01-12 19:30:01.618 Agent message code 14260. You do not have sufficient permission to run this command. Contact your system administrator.

Can you verify the following?

Distribution Agent for a push subscription

The Windows account under which the agent runs is used when it makes connections to the Distributor. This account must:

At minimum be a member of the db_owner fixed database role in the distribution database.

Be a member of the PAL.

Have read permissions on the snapshot share.

Have read permissions on the installation directory of the OLE DB provider for the Subscriber if the subscription is for a non-SQL Server Subscriber.
|||Hi Gray,

Thank you for interesting in my problem.

As I wrote is my first post, I set all required settings ti the distributor Windows account:
it is db_owner of the distribution database|||

Hi Igor,

This error message should not be related to running executables. It is more like SQL permission issue. I would try to turn on SQL profiler to trace the statement in replication SPs. Then we can find out where the 14260 error message is thrown.

Thanks,

Peng

|||Hi Peng,

Thank you for interesting on my problem. It really was related to the SQL rights. Actually, whe I added the distributor user to the db_owner role on the distribution database, the subscription started working properly.

Thank you,
Igor