Monday, June 24, 2013

[SQL Server] How to make hierarchical structure

[SQL Server] How to make hierarchical structure


How to make hierarchical structure

Posted: 24 Jun 2013 12:57 AM PDT

I have 5 tables and query has returned from these tables.Table1=tldDocuments{Docid (pk, Auto number)Title (text)Doc (text)}Docid Docno1 doc-0012 doc-005 1 Table2-tblTransmittalNo{Transid (pk, Auto number)Tansmittalno (text)}Transid transmittalno1 tt-0002Table3=tblTransmittals{Docid (fk to tblDocuments, number)Transid (fk to tblTransmittalNo, number)}Docid Transid1 12 1Tables 4= tblTranstoCon{TransmittalToConId (pk,auto number)TransmittaltoCon (text)}TransmittalToConId TransmittaltoCon1 CON-00032 CON-00053 CON-0007 Table 5{Docid (number,PK,fk to tblTransmittals)Transid (number,PK, fk to tblTransmittals)TransToCon (number,PK,fk to tblTranstoCon)}Docid Transid transmittalToConid1 1 12 1 21 1 3Table 5 has 2 fks (combine fields) to table3 because I have for same (docid,transid) different tranmittaltoConIdI have designed tables 2 years ago I do not know it is completely correct or no and I have entered data to the tables, if design of tables also has problem please help.But now I like to make a hierarchical structure for the returned data with below query with adding fields parenntid,positionQuery:SELECT tldDocuments.Docno, tblTransmittalNo.Tansmittalno, tblTranstoCon.TransmittaltoConFROM tblTranstoCon INNER JOIN ((tblTransmittalNo INNER JOIN (tldDocuments INNER JOIN tblTransmittals ON tldDocuments.Docid = tblTransmittals.Docid) ON tblTransmittalNo.Transid = tblTransmittals.Transid) INNER JOIN tblDocTrantoCon ON (tblTransmittals.Transid = tblDocTrantoCon.Transid) AND (tblTransmittals.Docid = tblDocTrantoCon.DocID)) ON tblTranstoCon.TransmittalToConId = tblDocTrantoCon.TransToCon;DocNo TransmittalNo TransmittaltoConDoc-001 tt-0002 con-0003Doc-001 tt-0002 con-0007Doc-005 tt-0002 con-0005 ID PARENT POSITION OPTION1 0 0 DOC-00012 1 0 TT-00023 0 1 DOC-00054 2 1 CON-00075 3 0 TT-00026 5 0 CON-0003

Data from two different databases

Posted: 24 Jun 2013 03:08 AM PDT

I'm new to the forum so I hope this is the right place to ask this question. I have a production and an archive database. I want to create a way to pull a combined report with data from both databases. The databases are identical and on the same SQL instance. I'm looking for the best solution to fit my needs. Can I create a view that will pull from views already created in both databases? Would SSAS or SSIS be more helpful in this? Ultimately I need to be able to run a report that pulls information from both databases into a single report where it looks like it comes from one data source. Thanks!Clint

Is it POSSIBLE to automatic change the language in reports?

Posted: 23 Jun 2013 10:18 PM PDT

Hello SQL Servercentral Guru's, I have a quick question about choosing languages. I have a number of reports that were created in the Dutch. Now I want that when opening the reports the possibility is to put it in English. If you have chosen that it automatically to English. Is that possible in visual studio 2010?greetzME.Be love be hate but still SQL!

Problem in SQL Server - Service Account

Posted: 23 Jun 2013 04:19 PM PDT

Hi All,Recently I am getting below error in all my SQL server error log, the error occured repeatedly. I just googled for this issues, so far i didn't find the clear solution. Can any one please help me to fix this issue. ThanksError Log:2013-06-24 12:30:41.49 Logon Login failed for user 'DOMAIN\SERVICEACCOUNT'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]2013-06-24 12:31:41.59 Logon Error: 18456, Severity: 14, State: 38.Regards,Amar

ERD in Visio

Posted: 23 Jun 2013 03:20 PM PDT

I am preparing the ERD in Ms. Visio 2010 premium edition.Apparently after I created the entities I figured out that am unable to resize them. I can move them but cannot resize. Tried the developer mode , snap sheet as suggested in other forums but its not helping...Any suggestions pls.

No comments:

Post a Comment

Search This Blog