Showing posts with label design. Show all posts
Showing posts with label design. Show all posts

Monday, March 19, 2012

Connecting to multiple SQLserver

Hello,

I am working on to design SSIS package which need to run scripts against multiple sqlserver and need help.

Basically I need to connect several SQLserver machine to get a data and insert to our central respository.

Any help or tip appreciated.

Thanks

--

Farhan

Farhan H Soomro wrote:

Hello,

I am working on to design SSIS package which need to run scripts against multiple sqlserver and need help.

Basically I need to connect several SQLserver machine to get a data and insert to our central respository.

Any help or tip appreciated.

Thanks

--

Farhan

Use multiple connection managers.

-Jamie

|||Is there any way I can read from text file salserver name and connect to particular server and run the scripts?|||

Farhan H Soomro wrote:

Is there any way I can read from text file salserver name and connect to particular server and run the scripts?

Yes. SSIS Configurations are provided to help you do exactly this.

Creating Package Configurations
(http://msdn2.microsoft.com/en-us/library/ms141132.aspx)

-Jamie

|||

If you have a list of servers that you want to run some SQL against, you can create two packages.

The simplest way to do this is create a SQL Server configuration table.
In the first package create a ForEach loop that processes each server in a resultset (I'd stick the list of servers in a SQL table so you can use it in reports).
In the ForEach loop
execute a SQL task to update the connection for the second package (the source server connection).
Then execute the second Package

In the Second package just create two connections, the source server to run the scripts against and the destination server to put the results in. Just use a data flow task to move the data.

|||

Thanks for the help. Just wondering how to setup SQL task to update the connection for the second package ?

TIA

--

Farhan

Sunday, March 11, 2012

connecting to database in runtime using visual basic 6

hi;
i design a crystal report outside visual basic 6. what i did is just calling the crystal report filename. how can i change the source database of my crystal reports in runtime. im using microsoft sql server. the two database had the same table structure.
thanksWhich version of CR are you using?
If it is CR9 then
cr.Database.LogOnServer "p2ssql.dll", "Server", "Database", "UserName,"Password"

Thursday, March 8, 2012

Connecting to Access2000 database at runtime from VB

Hi,

I want to connect to Crystal reports from VB.I am using CR ver 8.5 The database should be set at runtime instead of design time so that where ever I place my application the report should work from that directory (it could be d:\ or e:\ or N:\). The path should not be hardcoded in the report where we give the set location path. plssss help me out, this is very urgent

venkyHi Venky,
See if this will help:
http://www.dev-archive.com/forum/showthread.php?t=337289|||strDBPath = App.Path & "\CTS.mdb"
Set conRep = conAPP.OpenReport(App.Path & "\reports\PCCost.rpt", 1)
Set crxDatafiles = conRep.Database.Tables
crxDatafiles(1).SetLogOnInfo (strDBPath)

but still i am getting the error "File could not be found" "PCMonAmtQ" at file location "CTS.mdb"

pls let me know what is the error

thanks in advance

venky|||Hmmmm, that's a strange error message. It seems like it is looking for a file called "PCMonAmtQ". Could that be associated with your db?

I wish I could be of more help, but I am at a lose here...

Keep me posted =)

Wednesday, March 7, 2012

Connecting to a different stored procedure at runtime

Hello..
I am using Crystal Reports 10. Am running the report through some asp pages. The report is tied to a stored procedure at design time. Can I make the report connect to a different stored procedure at runtime? Both these stored procs have the same output in terms of columns. They differ only in the data.
Thanks,
ManishTry this
In your Application Use

CR.Database.tables(0)="SP Name"

Saturday, February 25, 2012

Connecting Tables

Hey everyone,
I am beggining in SQL and the .NET framework and have been running into some problems trying to design a relational database. I am completely new to it so I bought a book that was recommended in this Forum called "Handbook of Relational Database Design" and it has been pretty usefull so far. RIght now I am trying to make the Logical Data Model before I make the Relational Data Model.
The problem that I am having right now is creating a table that is a derivation from another table. For example, in the book they have a table called Property, and then two other tables called MountainProperty and BeachProperty. MountainProperty and BeachProperty are a type (relationship here) of a property. So basically Property will hold some data in a table, and then MountainProperty and BeachProperty will extend that property to contain more specific data. This is very similar to what I want to do. However I am having a problem understanding how an instance (or row) in Property, will have a link (foreign key) to a piece of data that is in Mountain or BeachProperty. I understand the foreign key in Mountain and BeachProperty and how they will link back to their "parent". But how will Property know its children, where is the link for that, how can one make a link to that. You could make a column with a foreign key, but which table would it point to, can one column point to mulitple tables? That doesn't make very much sense to me.
Basically what I am trying to say is that a row in the Property table can be multiple types, and these types will store more additional data about that row. How can I link to that data from that row in the table Property.
The only way that I can think of to link to that table is by making another column called PropertyType where MountainProperty equal 1 and BeachProperty equals 2. So I would perfrom a query in my application on the row like "Select PropertyType from Property" which would give me back 1 or 2. Based upon that I would then know which table to search for in the database and would then perfrom another query on the specific table, either MountainProperty or BeachProperty.
I am terribly sorry if this is confusing or if it is so appartently easy for you, but this is the first time that I have ever tried to make a relational database and I am really struggling on seeing how to organize these tables properly. Thank yor for your time.
Jeremy

(But how will Property know its children, where is the link for that, how can one make a link to that. You could make a column with a foreign key, but which table would it point to, can one column point to mulitple tables? That doesn't make very much sense to me.
Basically what I am trying to say is that a row in the Property table can be multiple types, and these types will store more additional data about that row.)

Hi,

I tried the answer your question but could not find it, tables in the relational model since I have been doing data back in 1998 are entities, the only property per ANSI SQL definition in the DDL(data definition language) is IDENTITY. So you design tables by files and association and relationship is determined by upper and lower bound cardinality.

There is a better book called Data Modeling by G. Lawrence Sanders and there are existing free data models you can clone to use. You questions about the relationship is through DRI(declarative referential integrity) which means if a references b b must exist so primary key a becomes foreign key b so you can use a to delete b Cascade Delete and a to update b Cascade Update and a to set b to default Cascade Set Default and Null Cascade Set Null. If the above is confusing it is because it was created with a 26 pages long algebra and took many years to implement. If you have many references then you need a DRI trigger because the built in version will not go beyond three. Hope this helps.


http://www.databaseanswers.org/data_models/index.htm

http://www.databaseanswers.com/modelling_books.htm

|||Truthfully, I didn't really understand anything you said, maybe just a little when you talked about the Cascade Delete stuff. But it was all inference. Anyone else have any suggestions for my predicament?
|||

EDIT

You did not understand it because I did not say what you expect, what I am saying the only properties relating to tables is IDENTITY so all you have been trying to create is not working because it is not correct. And spend time with the links posted because that material is by Data Modeling experts.

|||

OK, as far as I understood you are talking about realtional inheritance. This is not automatically possible in SQL Server, you will (according to your sample) have to implement that on your own. Let me explain how I see your problem: You have two tables, one tables with the common values for properties (the parent table) and the specific table according to the type mentioned in the property table. If you query the table property you want SQL Server to pick either the child values from the one or the other child table, depending on the property type in the parent table. Unfortunately and as aletady mentioned, this is not implemented in SQL Server. Although a FK / PK raltionships can be implemented you will have to you aour own retrieval logic to get the data back. You can implement this usingeither client logic or server logic (like stored procedures). Hope that hits your question, if not do not hesitate coming back.

Jens K. Suessmeyer


http://www.sqlserver2005.de