Tuesday, March 27, 2012
Field accumulation
I am building a crystal report for a timeclock program.
Currently I have the report displaying all employee punches and accumlating each punch at the end of the row as follows:
Time In Time Out Status Total
9/15/05 8:00 am 9/15/05 12:00 pm Working 4.00
9/15/05 12:00 am 9/15/05 1:00 pm Lunch 1.00
9/15/05 1:00 am 9/15/05 5:00 pm Working 4.00
At the bottom of the report I want to display the total hours for each status type for the pay period.
Lunch Total Break Total Reg Hours ect...
How can I accumlate the total for these fields? Sorry if this is an amature question, been racking my brain and searching diligently without any useful results.
Any help is greatly appreciated
Thanks,
LarryDo you want to show the total of times?
Friday, March 23, 2012
federated query architecture advice
I'm involved in a project building a federated query app. There is an ASP.NET web app talking to a central SQL Server 2005 db. Users input query parameters to the web ap, the request is submitted as a stored procedure to a central db, and from there it is distributed to the selected remote SQL Server 2005 db servers with similar but not necessarily identical schemas where the actual data resides.
We must wait for all servers to execute the query and return the results, then aggregate those query results and present them to the web app user.
The question is, what is the best way to design this with Server 2005? We need to be able to initiate multiple concurrent queries, then wait (up to some max timeout value) for all responses to return. What way(s) do I have with SQL Server 2005 to (1) initiate multiple queries, and (2) wait on the events (queries) to complete, up to some max timeout value?
I've looked at Service Broker some but that (maybe) seems like more than we need because all we're doing are queries. The tricky part seems to be initiating concurrent queries and waiting for all responses. Any advice or comments are appreciated.
Using SQL Server 2005 and ADO.NET 2.0 will enable you to do async queries / commands to the database. THis might be the best solution for you.HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||I was hoping for a single stored procedure (sp) with a parameter naming the data sources to be queried. The sp would start multiple parallel queries, then consolidate the results into a single result set to return to the caller. Any ideas along these lines?|||
Just to get some understanding why do need to use federated searches. Are you running into scale problems?
The one solution is to use partitioned views, this enables the Query Optimiser to figure out which servers to query.
|||We have multiple SQL Server databases with essentially identical schemas. These databases are located remotely from our central server (assuming we'll connect via vpn or...?). The idea is for a stored procedure call to be made to the central server that will in turn query the remote servers, with the consolidate / federated result set from all servers involved returned to the caller as a single result set.
Looks like I need to look into partitioned views; I presume this requires linked servers? If so, I've heard about problems with links staying "up" over extended periods when the remote servers are not connected to a LAN - any feedback on this question?
|||Federation is for searching across multiple servers in a single location (in my opinion) not bringing remote data together.
Based on what you have said I believe you should be looking at a replication model. Each of your sites replicates data to the central point. The queries at the central point are then on local copies of the data.
Doing distributed queries when you have a poor connection is just not practical. Replication can handle this level of connectivity.
If you have Site A, Site B and SIte C and you need to have users in all sites seeing data from the other sites, you probably want to look at peer to perr transactional replication.
|||Normal replication is not an option. Here's the scenario: we have multiple heterogeneous "source" systems (Oracle, Informix, SQL Server, etc.), each unique and different. Co-located with each source system is a SQL Server db. On a daily basis, the relevant tables from the source systems (which can be several GB's in total) will be copied into equivalent SQL Server tables using SSIS. (This is why replication to a central db is not an option; take this as a given, trust me). From the source schema, the data will be transformed (again via SSIS) into a "provider" schema on the co-located server. These provider schemas will be similar but not identical. We want to query and aggregate results from the provider schemas.
For example, if we have 4 sites (A, B, C, and D), and the user wants to query sites A and C, we want to fire-off parallel queries at site A nd site C. The rowset structure from the two sites will be identical, but the queries that produce them will not necessarily be identical. The final step is to combine the result sets from sites A and C and return the combined rowset to the stored procedure caller.
Once again, the co-located SQL Server boxes will be accessed over the Internet (via vpn?).
|||When you say trust me are you referring to office politics or are you referring to a technical problem? It appears (to me) that the co-located Sql Server databases (sources) could replicate to a single SQL Server database (target) from which querying could be performed. The target database could define a field to show the source of the data co-located Sql Server databases.Wednesday, March 21, 2012
Feasability of storing PDFs and WORD.DOC files in MSSQL?
I will be storing the document on the hard-drive for quick/easy access,
but I was also thinking of storing it in an existing database since most
of the sites information is all stored there.
As well there would be only one place to worry about backing up. And if
the file on the hard-drive was ever missing or became corrupted, I could
restore it form tha database. Is this feasable? Has anyone ever done this?
--
* Don Vaillancourt
Director of Software Development
*
*WEB IMPACT INC.*
phone: 416-815-2000 ext. 245
fax: 416-815-2001
email: donv@.web-impact.com <mailto:donv@.webimpact.com>
web: http://www.web-impact.com
/ This email message is intended only for the addressee(s)
and contains information that may be confidential and/or
copyright. If you are not the intended recipient please
notify the sender by reply email and immediately delete
this email. Use, disclosure or reproduction of this email
by anyone other than the intended recipient(s) is strictly
prohibited. No representation is made that this email or
any attachments are free of viruses. Virus scanning is
recommended and is the responsibility of the recipient.
/
Don Vaillancourt wrote:
> I'm building a system when one can upload a document to the website.
> I will be storing the document on the hard-drive for quick/easy access,
> but I was also thinking of storing it in an existing database since most
> of the sites information is all stored there.
> As well there would be only one place to worry about backing up. And if
> the file on the hard-drive was ever missing or became corrupted, I could
> restore it form tha database. Is this feasable? Has anyone ever done
> this?
Sure it's possible to save any size binary object in the DBMS, but it is
not usually a performant use of a DBMS as a simple file store. I would
first consider a hardware solution for backups of read-only files. Either
just store copies on separate disks, or get a fancier RAID setup where
any one disk failure won't lose any data.
Joe Weinstein at BEA|||Don Vaillancourt (donv@.webimpact.com) writes:
> I'm building a system when one can upload a document to the website.
> I will be storing the document on the hard-drive for quick/easy access,
> but I was also thinking of storing it in an existing database since most
> of the sites information is all stored there.
> As well there would be only one place to worry about backing up. And if
> the file on the hard-drive was ever missing or became corrupted, I could
> restore it form tha database. Is this feasable? Has anyone ever done
> this?
I have not done this myself, but certainly it is a common scenario.
Storing the documents on disk makes for a simple implementation.
Storing them in the database requires a battle with the text/image
data types, which are somewhat difficult to use.
But as you note, storing in the database is safer. Backup is simpler,
and a file on directory can easily "disappear". And if all you store
is the file path, another problem is that you don't have two-phase
commit with the file system.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||I know that technically I can store this info in the database and
retrieving it is not an issue.
My issue really is how manageable will the database be with tons of
PDFs, Word, etc. documents in it. Or how willing people would be
willing to manage such a beast.
Right now our databases are about 300MB each. I may decide to create a
second database, not sure, but the total number of documents may be at
the very least in the 1000's which would most probably create a database
about 5GB + overhead.
To some this may be an intimidating size to manage. It would certainly
fit on a tape backup.
I'm just wondering about other issues that may come up.
Erland Sommarskog wrote:
> Don Vaillancourt (donv@.webimpact.com) writes:
>>I'm building a system when one can upload a document to the website.
>>
>>I will be storing the document on the hard-drive for quick/easy access,
>>but I was also thinking of storing it in an existing database since most
>>of the sites information is all stored there.
>>
>>As well there would be only one place to worry about backing up. And if
>>the file on the hard-drive was ever missing or became corrupted, I could
>>restore it form tha database. Is this feasable? Has anyone ever done
>>this?
>
> I have not done this myself, but certainly it is a common scenario.
> Storing the documents on disk makes for a simple implementation.
> Storing them in the database requires a battle with the text/image
> data types, which are somewhat difficult to use.
> But as you note, storing in the database is safer. Backup is simpler,
> and a file on directory can easily "disappear". And if all you store
> is the file path, another problem is that you don't have two-phase
> commit with the file system.
>
--
* Don Vaillancourt
Director of Software Development
*
*WEB IMPACT INC.*
phone: 416-815-2000 ext. 245
fax: 416-815-2001
email: donv@.web-impact.com <mailto:donv@.webimpact.com>
web: http://www.web-impact.com
/ This email message is intended only for the addressee(s)
and contains information that may be confidential and/or
copyright. If you are not the intended recipient please
notify the sender by reply email and immediately delete
this email. Use, disclosure or reproduction of this email
by anyone other than the intended recipient(s) is strictly
prohibited. No representation is made that this email or
any attachments are free of viruses. Virus scanning is
recommended and is the responsibility of the recipient.
/|||Don Vaillancourt (donv@.webimpact.com) writes:
> I know that technically I can store this info in the database and
> retrieving it is not an issue.
> My issue really is how manageable will the database be with tons of
> PDFs, Word, etc. documents in it. Or how willing people would be
> willing to manage such a beast.
> Right now our databases are about 300MB each. I may decide to create a
> second database, not sure, but the total number of documents may be at
> the very least in the 1000's which would most probably create a database
> about 5GB + overhead.
> To some this may be an intimidating size to manage. It would certainly
> fit on a tape backup.
Few of our customers that run our system have databases that small. My test
database alone is 600 MB.
And 5 GB in one database is easier to manage, than 300 MB in a database + a
lot of loose files.
However, if you are using MSDE the size could be a concern, since MSDE
has a size limit of 2 GB.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||No MSDE for us. We tell how clients which version of whatever database
they must purchase in order to use our software.
Otherwise, from your experiences, my issue is really a non-issue.
Thanks for your input.
Erland Sommarskog wrote:
> Don Vaillancourt (donv@.webimpact.com) writes:
>>I know that technically I can store this info in the database and
>>retrieving it is not an issue.
>>
>>My issue really is how manageable will the database be with tons of
>>PDFs, Word, etc. documents in it. Or how willing people would be
>>willing to manage such a beast.
>>
>>Right now our databases are about 300MB each. I may decide to create a
>>second database, not sure, but the total number of documents may be at
>>the very least in the 1000's which would most probably create a database
>> about 5GB + overhead.
>>
>>To some this may be an intimidating size to manage. It would certainly
>>fit on a tape backup.
>
> Few of our customers that run our system have databases that small. My test
> database alone is 600 MB.
> And 5 GB in one database is easier to manage, than 300 MB in a database + a
> lot of loose files.
> However, if you are using MSDE the size could be a concern, since MSDE
> has a size limit of 2 GB.
--
* Don Vaillancourt
Director of Software Development
*
*WEB IMPACT INC.*
phone: 416-815-2000 ext. 245
fax: 416-815-2001
email: donv@.web-impact.com <mailto:donv@.webimpact.com>
web: http://www.web-impact.com
/ This email message is intended only for the addressee(s)
and contains information that may be confidential and/or
copyright. If you are not the intended recipient please
notify the sender by reply email and immediately delete
this email. Use, disclosure or reproduction of this email
by anyone other than the intended recipient(s) is strictly
prohibited. No representation is made that this email or
any attachments are free of viruses. Virus scanning is
recommended and is the responsibility of the recipient.
/
Sunday, February 26, 2012
FAQ: Are there any whitepapers about building a Disaster Recovery site at a remote location for
Hi,
Sorry for the wide distribution.
I'm trying to find any useful whitepapers about how to effectively build and operate a disaster recovery site at a remote location for SQL Server 2000. Does anyone know where to find such information?
I also know that one good option for my customer is using the Mirroring feature of SQL Server 2005. What are the other options? Is Replication an effective one for a mission-critical database (online banking)?
Thanks in advance
here are some articles and white papers that may be helpful to you:
SQL Server 2005 Failover Clustering White paper
http://www.microsoft.com/downloads/details.aspx?FamilyID=818234dc-a17b-4f09-b282-c6830fead499&DisplayLang=en
Database Mirroring in SQL Server 2005
http://www.microsoft.com/technet/prodtechnol/sql/2005/dbmirror.mspx
SQL Server 2000 High Availability Series
https://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/harag01.mspx
SQL Server 2000 Backup and Restore
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlbackuprest.mspx
|||
I'm not trying to endorse products and I'm not claiming to know the most about this topic. There are many people that have a lot more insight into the specifics but these are intended to give you some quick and dirty information.
I haven't been able to find anything that specifically addresses the DR for SQL Server 2000 that is all encompassing. In general there are somethings that you could consider that vary in costs as your recovery techniques become more sophisticated.
Some options that are available within SQL 2000 are:
Log shipping: I believe that you send log backups and restore them at the far end without recovery. When a disaster occurs you restore the last log backup with the WITH RECOVERY option and your off and running on your backup server.
Replication: The freshness of the data at the far end will depend on the replication model chosen. Real time can be very demanding if you're planning on replicating every table in every database on your SQL Server. Generally speaking there is less overhead the more specific you could be. There are some functionality constraints that you will have to investigate to see how well they will work for you. For example if you add a column to a table that is being replicated you will have to manually add that column to the subscription for the subscribers to receive it. This is a very simple example.
Some options that are available within SQL 2005
Log shipping: Works similarly to SQL 2000.
Replication: Much improved over SQL 2000. Subscriptions automatically add columns added to tables now. Very slick.
Database Mirroring: Just had this functionality enabled with SP1. There is a lot to consider with this model. There is a primary database server, a secondary or backup database server, and a witness database server. The witnesses function is to control when the failover happens amongst other things. One of the downfalls are incorrect failovers.There are instances of the witness server incorrectly identifying a failed primary server and forcing traffic to the backup. Also I'm not sure how smooth the failback works.
Warm database server just needing to have SQL databases restored. This is a very low cost and not very real time option. This is SQL version independent.
There are several different third party High Availability/ Disaster Recovery products that are out there. Depending on how sophisticated a failover you'll need to have.
Sonasoft - Sonasafe for SQL Server - www.sonasafe.com
Neverfail - Neverfail for SQL Server - www.neverfailgroup.com
This is a very broad topic to try to address I'm sorry if this information hasn't been helpful. If you'd like to compare notes, I'd be glad to discuss some of my findings. I'm going through a very similar experience right now. Except we are a SQL 2005 only shop.
The other thing that you didn't mention is whether or not you're considering clustering. This adds a whole additional level of complexity to the considerations.
Drew Flint
FAQ: Are there any whitepapers about building a Disaster Recovery site at a remote location
Hi,
Sorry for the wide distribution.
I'm trying to find any useful whitepapers about how to effectively build and operate a disaster recovery site at a remote location for SQL Server 2000. Does anyone know where to find such information?
I also know that one good option for my customer is using the Mirroring feature of SQL Server 2005. What are the other options? Is Replication an effective one for a mission-critical database (online banking)?
Thanks in advance
here are some articles and white papers that may be helpful to you:
SQL Server 2005 Failover Clustering White paper
http://www.microsoft.com/downloads/details.aspx?FamilyID=818234dc-a17b-4f09-b282-c6830fead499&DisplayLang=en
Database Mirroring in SQL Server 2005
http://www.microsoft.com/technet/prodtechnol/sql/2005/dbmirror.mspx
SQL Server 2000 High Availability Series
https://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/harag01.mspx
SQL Server 2000 Backup and Restore
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlbackuprest.mspx
|||
I'm not trying to endorse products and I'm not claiming to know the most about this topic. There are many people that have a lot more insight into the specifics but these are intended to give you some quick and dirty information.
I haven't been able to find anything that specifically addresses the DR for SQL Server 2000 that is all encompassing. In general there are somethings that you could consider that vary in costs as your recovery techniques become more sophisticated.
Some options that are available within SQL 2000 are:
Log shipping: I believe that you send log backups and restore them at the far end without recovery. When a disaster occurs you restore the last log backup with the WITH RECOVERY option and your off and running on your backup server.
Replication: The freshness of the data at the far end will depend on the replication model chosen. Real time can be very demanding if you're planning on replicating every table in every database on your SQL Server. Generally speaking there is less overhead the more specific you could be. There are some functionality constraints that you will have to investigate to see how well they will work for you. For example if you add a column to a table that is being replicated you will have to manually add that column to the subscription for the subscribers to receive it. This is a very simple example.
Some options that are available within SQL 2005
Log shipping: Works similarly to SQL 2000.
Replication: Much improved over SQL 2000. Subscriptions automatically add columns added to tables now. Very slick.
Database Mirroring: Just had this functionality enabled with SP1. There is a lot to consider with this model. There is a primary database server, a secondary or backup database server, and a witness database server. The witnesses function is to control when the failover happens amongst other things. One of the downfalls are incorrect failovers.There are instances of the witness server incorrectly identifying a failed primary server and forcing traffic to the backup. Also I'm not sure how smooth the failback works.
Warm database server just needing to have SQL databases restored. This is a very low cost and not very real time option. This is SQL version independent.
There are several different third party High Availability/ Disaster Recovery products that are out there. Depending on how sophisticated a failover you'll need to have.
Sonasoft - Sonasafe for SQL Server - www.sonasafe.com
Neverfail - Neverfail for SQL Server - www.neverfailgroup.com
This is a very broad topic to try to address I'm sorry if this information hasn't been helpful. If you'd like to compare notes, I'd be glad to discuss some of my findings. I'm going through a very similar experience right now. Except we are a SQL 2005 only shop.
The other thing that you didn't mention is whether or not you're considering clustering. This adds a whole additional level of complexity to the considerations.
Drew Flint