Showing posts with label figuring. Show all posts
Showing posts with label figuring. Show all posts

Wednesday, March 28, 2012

One Database or More

A bit of advice needed, as I'm having trouble figuring out whether I need to create multiple SQL Server databases or just one...or if it is a matter of choice.

Say I'm creating Website A that does one thing.

And Website B that does another thing.

But each one has common core underlying tables (customers, cargos, ports, etc) that they both use.

Am I best just creating one database or several? Then am I best creating two or three (A,B and core tables)?

Not that used to SQL server at the moment, and this will be a complete backend for the companies main core business, crm, quality, etc - all distinct apps so to speak, but the data has common underlying tables and they will want to cross-reference data.::Am I best just creating one database or several?

This absolutly and 100% depends on whether you want them or not.

In this case:

::Not that used to SQL server at the moment, and this will be a complete backend for the
::companies main core business, crm, quality, etc - all distinct apps so to speak,

No, these are NOT distinct apps. They are all parts of one suite running the company. In this case it is absolutly best to run all this:

* From one database
* with ONE SET OF BUSINESS OBJECTS.|||Yes - part of one suite. Thanks.

Saturday, February 25, 2012

OLE DB Command

I am having trouble figuring out how to use the OLE DB Command (for updating a record). On the first tab (Connection Managers), I can select my database server under 'Connection Manager'. When I looked at the second tab (Component Properties) I thought, this does not seem to have anything related to choosing a data TABLE to use. The third and fourth tabs do not seem to work because they require an output and none is there, and I can't add one (?)

When I selected the 3rd tab, I see the following at the bottom of the window :

Error at ReadAL3Files [OLE DB Command [6638]]: An OLE DB error has occured. Error code: 0x80040E0C. An OLE DB record is available. Source "Microsoft SQL Native Client" Hresult: 0x80040E0C Description: "Command text was not set for the command object"

So I look at the properties for the components, to see if there is one where 'text' is not set. Then I think, maybe I have to enter the update statement directly (under SQL Command). There didn't seem to be a way to build this kind of statement, so I guessed at the syntax

update [dbo].[BriteMeter]
set sampledatetime = [Column_7],
GradeID = [Column_8]
where SampleID = SampleID;

and switching to tab 3 and 4 showed a different error :
Statement(s) could not be prepared
Invalid column name 'Column 8'
Invalid column name 'Column 7'

I've tried entering those column names as described here : http://technet.microsoft.com/en-us/library/ms141138.aspx. Tried putting them in quotes, square brackets, I always get that error.

Am I approaching this right or am I missing something?

Dear Friend,

Create the update SQL statment inside database as a stored procedure with input and output parameters.

And in the OLE DB Command text property write: EXEC StoredProcedure ?,?

This example has 2 input parameters.

In my blog check the label SSIS and there is an example.

Helped?

regards!

|||Seriously? There is no simpler way to do an update than this? Well... ok.

|||

Dear friend,

In my opinion, is the better way to do that. The most advantages with this way is that:

1. You avoid SQL injection

2. The SP is already compiled in your database.

3. in the case you need to make some changes, you only need to change the SP in spite of change the stored procedure...

Helped? :-(

I hope so... if not tell me!

Kind regards!