Thursday, March 8, 2012
Copy data for reports
to another database for some lengthy numeric calculations and a report.
Phantom rows inserted during the copy operation would be a problem but
a serializable transaction would impact availability. I was
considering using BCP to export the data with a query since I think it
would be faster than directly copying across databases with t-sql. The
BCP docs dont say anything about other users inserting during a bulk
export. Are inserts prevented during bulk export? Is BCP a good way
to go? Other options? I must support sql2k and cannot rely on new 2005
features.
Jim KaneYou could restore or re-attach a backup of the production database.
<jkane@.satx.rr.com> wrote in message
news:1134740711.836936.47380@.g47g2000cwa.googlegroups.com...
>I need to copy a significant amount of data (1-2gb) during work hours
> to another database for some lengthy numeric calculations and a report.
> Phantom rows inserted during the copy operation would be a problem but
> a serializable transaction would impact availability. I was
> considering using BCP to export the data with a query since I think it
> would be faster than directly copying across databases with t-sql. The
> BCP docs dont say anything about other users inserting during a bulk
> export. Are inserts prevented during bulk export? Is BCP a good way
> to go? Other options? I must support sql2k and cannot rely on new 2005
> features.
> Jim Kane
>
Friday, February 10, 2012
Converting oracle calculation to sql server 2005 calculation
Hi I am having to convert some oracle reports to Reporting Services. Where I am having difficulty is with the
calculations.
Oracle
TO_DATE(TO_CHAR(Visit Date+Visit Time/24/60/60,'DD-Mon-YYYY HH24:MISS'),'DD-Mon-YYYY HH24:MISS')
this is a sfar as I have got with the sql version
SQLSERVER2005
= DateAdd("s",Fields!VISIT_DATE.Value,Fields!VISIT_TIME.Value\24\60\60 )
visit_date is date datatype visit_time is number datatype. have removed : from MI(here)SS as was showing as smiley.
using:
VS 2005 BI Tools
SQLServer 2005
You need SQL Server convert code 13 or 113, try the link below for all the conversion codes. Hope this helps.
http://sqljunkies.com/HowTo/6676BEAE-1967-402D-9578-9A1C7FD826E5.scuk
|||Thanks for the reply, I tried....
= Convert(varchar(10),DateAdd("s",Fields!VISIT_DATE.Value,Fields!VISIT_TIME.Value\24\60\60,103)
'Convert' is underlined red tool tip says 'unrecognised identifier'
|||The link I gave you is for you to do the caculations in the database not Reporting services table control Expression box.
|||Thanks, much easier doing calculated fields in db.