Showing posts with label runs. Show all posts
Showing posts with label runs. Show all posts

Friday, March 23, 2012

Push and Pull subscription?

As I understand replication in Sql2K the only difference in push or pull subscriptions is where the agent runs. If I wanted changes in the publisher to be sent to the subscribers immediately after the change then I thought push would be better. But, if I am equally interested in changes made at the subscriber then what should I use? Or does the agent monitor both the publisher and subscriber at the same time?

Thanks for your help

Graham

Graham, assuming you're talking about merge replication, changes will be propagated up/down whenever the agent runs. If you run the agent in continuous mode, then the changes should be sent within the polling period of the agent. If you run the agent in a scheduled mode, or on demand, then the changes will be sent when the agent runs.

Tuesday, March 20, 2012

pulling my hair out!

I'm trying to do a simple DTS data transfer from an ODBC connection to a fox pro database to MS SQL 2000.

THe package runs fine, data moves over.

HOwever, one of the tables contains what used to be sales dollars from the originating fox pro table which is a currency data type.

the sql table is using a money data type.

what's happening, i finally noticed, is that all negative dollars are being translated into 0 values.

i've tried making the sql table a decimal data type, i've switch the vfpodbc.dll from the June 2003 version to the 1999 version and it's all the same.

when i connect to the fox pro database using the same driver, it shows the negative values in the db. yet when I run (select * from sales where salesamount <0) there are no negative values at all. there either positive or zero.

i'm going to simply scream i'm so freakin frustrated. why the heck in 2003 cant we exchange a simple currency data element from a **MICROSOFT** product to a **MICROSOFT** product.

Sorry for the tone. It's crap like this that adds to project time. I've spent 8 hours now, one whole developer day trying to fix. Of course, Microsoft no longer provides an easily downloadeable driver upgrade. It's missing from there site. So finding the latest fox pro driver is not an easy task.

Trying to download and install MDAC 2.8 says right on the download page that it does not include OLEDB and ODBC drivers any longer. Well what the heck good is that? Great...we get the latest ado or ado.net updates. Whoopee! Retards! You need the drivers to utilize ADO or ADO.NET...HELLO!

sorry again guys, but i'm about to go postal. i just hate this stupid crap. And I hate it when I peruse MS KB and it doesn't come up with crap. never does. have to use google. Perhaps MS should buy out google and replace there search technology to something that actually WORKS.

So, now that i've had my little anit-microsoft tired, is there any one who would be willing to lend any advice about why negative currency values are being translated to 0 values from a foxpro currency type to a microsoft sql decimal or money data type?are you using the SQL 2000 Import/Export tool?

you might need to delve into the 'transform' dialog and do a manual CAST on the field.

I've had to do something broadly similar for the last month because some genius in an [unnamed] government department thinks that my data needs are based on some guy from Ballarat inputting 125000 fieldsby hand. Why the [****] you'd do unnecessary casts or processing in exporting data to go from one SQL Server database to another I really will never, ever know. I guess stupidity never goes out of fashion, but it has to be dealt with.

In your case, some pre-processing may be the thing. going from one platform from another may screw up by default but can be conquered by DTS in the vast majority of cases.

j|||As Atrzx mentioned, you may have to do an ActiveX Script on your transform of that data element. Since it's vbscript, something like
DTSDestination("elem_id") = CCurr(DTSSource("Current Element ID"))

might do the trick.

Friday, March 9, 2012

Pull Date for Last Thursday

Hi,

I am having a problem with a report. An extract runs every Thursday and on the last day of the month. I need the report to run on-demand for the most recent Thursday (so, if they run it on Fri, Sat or Sun, they get last Thursday's value).

I can't figure out how to pull data where the completedate = last Thursday's date.

Thanks,

RC

I use a function similar to this:

Code Snippet


CREATE FUNCTION dbo.LastThursday
( @.DateIn datetime,
@.WithTime bit = 0 -- 1=Yes, 0=No
)
RETURNS datetime
AS
BEGIN
DECLARE
@.DateOut datetime,
@.NumDays int

SELECT @.NumDays = CASE datepart( dw, @.DateIn )
WHEN 1 THEN 3
WHEN 2 THEN 4
WHEN 3 THEN 5
WHEN 4 THEN 6
WHEN 5 THEN 7
WHEN 6 THEN 1
WHEN 7 THEN 2
END

IF ( @.WithTime = 1 )
SET @.DateOut = dateadd( day, -@.NumDays, @.DateIn )
ELSE
SET @.DateOut = cast( convert( char(10), dateadd( day, -@.NumDays, @.DateIn ), 101 ) AS datetime )

RETURN @.DateOut

END
GO

Usage:

Code Snippet


SELECT dbo.LastThursday( getdate(), 0 )
-
2007-06-07 00:00:00.000

In your Query WHERE clause:

WHERE CompleteDate = dbo.LastThursday( getdate(), 0 )

If you use this on Thursday, this week, it will return Thursday LAST week. If you want it to return Thursday, this week, change the "WHEN 5 THEN 7" to "THEN 0"

Publishing subreports

One of my reports uses a subreport. I use a script that runs under RS.EXE to
publish the reports, with the result that the subreport appears in the list
view where the user may be tempted to go in and try to run it, even though
it's not intended for stand-alone use.
I can hide it by going to Properties/General and checking off "Hide in list
view", but I would prefer to make the setup completely automatic.
Is there any way to set "Hide in list view" directly from the script?
Thanks,
PeterSure. Have a look at the scripts generated by Reporting Services Scripter
for a hidden report
http://www.sqldbatips.com/showarticle.asp?ID=62
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"jpstewart" <jpeterstewart@.hotmail.com.nospam> wrote in message
news:399E98E6-3543-4204-A9F6-484A1C527D99@.microsoft.com...
> One of my reports uses a subreport. I use a script that runs under RS.EXE
> to
> publish the reports, with the result that the subreport appears in the
> list
> view where the user may be tempted to go in and try to run it, even though
> it's not intended for stand-alone use.
> I can hide it by going to Properties/General and checking off "Hide in
> list
> view", but I would prefer to make the setup completely automatic.
> Is there any way to set "Hide in list view" directly from the script?
> Thanks,
> Peter
>|||Did you get an idea of how to access Hide in List view property programatically?. I am also strugling with the same problem. Please send me the reply to my gmail
From http://www.developmentnow.com/g/115_2005_8_0_0_574025/Publishing-subreports.ht
Posted via DevelopmentNow.com Group
http://www.developmentnow.com