Showing posts with label program. Show all posts
Showing posts with label program. Show all posts

Thursday, March 29, 2012

database speed in SQL server

Hi there,
My program in Delphi have 7 table with about 120,000 records and 200 fields.
I use SQL server for my database.
When my program launchs its speed is too low.
What shall I do to increase its speed?
Regards,
Doroodgarit probably has nothing to do with the number of tables and records in the
database. you can try several things:
* delay creating unnecessary objects and forms, and create them as needed
* delay connecting to the database, and again connect only when needed
* move time-consuming processing to background thread, if possible
* show splash screen, it will make the appearance better :)
in general, minimize the amount of work you perform on load.
btw, those '200 fields' seem pretty much..
dean
"doroodgar" <rdoroodgar@.noornet.net> wrote in message
news:uTKCZCpDFHA.148@.TK2MSFTNGP14.phx.gbl...
> Hi there,
> My program in Delphi have 7 table with about 120,000 records and 200
fields.
> I use SQL server for my database.
> When my program launchs its speed is too low.
> What shall I do to increase its speed?
> Regards,
> Doroodgar
>|||HI doroodgar,
You sound convinced SQL slow your application purely on the fact the you
return tons of records so I'll work with that.
Why do you need that size recordset on application launch ? This confuse me
a bit cause you load the records based on what ?
What does your application do ? Is there some sort of logic to the records
that you return, is it possible that you can narrow it down , you present
120k records on one page anyways... should you maybe try and load 100 at a
time ?
How do you application present the 200 fields ?
Is it a straight select statement that populate your recordset or do you use
joins ?
What's the timing compared to when you run it through QA ?
Hope this will help
Can you give more info regarding your query and application ?
"doroodgar" wrote:

> Hi there,
> My program in Delphi have 7 table with about 120,000 records and 200 field
s.
> I use SQL server for my database.
> When my program launchs its speed is too low.
> What shall I do to increase its speed?
> Regards,
> Doroodgar
>
>|||http://www.sql-server-performance.com
Regards
Mike
"Mal" wrote:
> HI doroodgar,
> You sound convinced SQL slow your application purely on the fact the you
> return tons of records so I'll work with that.
> Why do you need that size recordset on application launch ? This confuse m
e
> a bit cause you load the records based on what ?
> What does your application do ? Is there some sort of logic to the records
> that you return, is it possible that you can narrow it down , you present
> 120k records on one page anyways... should you maybe try and load 100 at a
> time ?
> How do you application present the 200 fields ?
> Is it a straight select statement that populate your recordset or do you u
se
> joins ?
> What's the timing compared to when you run it through QA ?
> Hope this will help
> Can you give more info regarding your query and application ?
> "doroodgar" wrote:
>sql

Sunday, February 19, 2012

Database question

Hello

I am using visual Basic 2005 express.

The program I am working on uses a database called DMGCollectionDatabase.mdf which will be held locally on the computer the program is installed on

When I publish my program as a cddvd install I get a setup file some other files and in the datasets folder I get a DMGCollectionDatabase.mdf.deploy file

if i install this program on a different computer than the one I used to build it it saves all the database information somewhere no clue where. what I need to be able to do is get the program to write to the DMGCollectionDatabase.mdf database so users can save this file with there information the dmg database will become portable my whole issue is how do I make this happen (I read one post that mentioned just using the .exe file and the database file in a folder this currently gives me an error)

If anyone could please assist me in this problem I would be greatly appriciative I am sorry if I seem a bit slow I am a self learner with visual Basic 2005 express I am about 3 months into things using vb2005 step by step and online help as references.

Hi Warren,

The issue is that SQL Server doesn't care what the *.mdf/*.ldf files are called, and by themselves, these files are worthless (unlike MSAccess)

What your setup will need to do is:

1. Verify that the target has a version of SQL Server installed

2. Create the DMGCollectionDatabase if it doens't already exist on the target sql instance, using the *.mdf & *.ldf file you mentioned. You do this via the sp_attach_db procedure. So, if your setup deploys the DMGCollectionDatabase.mdf and DMGCollectionDatabase.ldf file to C:\SomeApp\DMGCollectionDatabase.mdf, you would issue the following command on the target sql server instance:

exec sp_attach_db @.dbname = 'DMGCollectionDatabase', @.filename1 = 'C:\SomeApp\DMGCollectionDatabase.mdf', @.filename2 = 'C:\SomeApp\DMGCollectionDatabase.ldf'

And away you go...

Cheers,

Rob

|||

When I put this code into my formmain load "exec" gives me a declaration expected.

I placed the code above the first public class

|||

Hi Warren,

The code exec sp_attach_db @.dbname = 'DMGCollectionDatabase', @.filename1 = 'C:\SomeApp\DMGCollectionDatabase.mdf', @.filename2 = 'C:\SomeApp\DMGCollectionDatabase.ldf' is executing an SQL Server stored procedure - it needs to be executed against an sql server instance. Most setup/deployment tools allow you to shell a command, but if you're trying to do this from within VB, then you can execute the command in the context of a valid ado connection obejct, use dmo/smo or shell the command via osql.exe:

osql -E -i "exec sp_attach... etc"

For all available switches, have a look at osql in BOL. If you're using SQL2005, you should use the sqlcmd utility instead.

Cheers,

Rob