How can I use two database in Dataset in SSRS?

Hi,
I am using one query to generate my SSRS report. In that query I am using subquery. Now I am pulling data from multiple tales.
DB used in sub query is different than the rest of the tables DB.(So total I am using 2 DB(Database))
So I see that in SSRS, I can connect query(In DataSet Properties) to one DATA_SOURCE only, how can I use other database which is I used in sub-query?
I have to move this SSRS into PROD and I can't hard code that sub-query's DB name in my query.
Please give me suggestion. Thanks!!
Vicky

In SSRS 2008 R2 you can use the Lookup function (http://technet.microsoft.com/en-us/library/ee210531.aspx ) and LookupSet function (http://technet.microsoft.com/en-us/library/ee240819.aspx
Depending on your security set up, you can reference a table in a second database on the same server using a three part name:  database.schema.table.  This is more likely to work for you if you wrap your SQL command in a stored procedure.
Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

Similar Messages

  • How can I use two database in an application?

    When I use two database like CloudscapeDB and TestDB in J2EE1.3.1, I always get some exceptions, which is unknow source about one of them.I am doing a CMP entity bean application. Can someone tell how to set up the environment and what is problem about the exceptions I met?
    Thanks.

    Hi,
    The basics for using the two databases is simple.
    For database configuration you have to provide the driver class name, url, schema name and password during the creation of the connection pools. So u can create a as many no. of connection pools as the no. of the databases.
    Hope it will work..

  • How can I combine two databases, from two computers, to have one combined database of messages?

    My old XP computer recently died and I had to build a new Windows 8.1 machine. While I was down I used a laptop as a temporary replacement. Now my new machine is running fine and receiving e-mail, but I now have two databases--one on the new machine and one on the laptop. Both are based on a recent backup, so they are lengthy--except that the new machine's database has a hole in it for the period I was on the laptop and the laptop's database also has gaps. How can I combine two databases into one that includes the messages from both machines?
    Thanks in advance,
    profsimonie

    Thanks for your reply. My profile folder did not contain any MBOX files. I found them in another folder on another drive. The Import-Export tools simply transferred each folder to the current one as a sub-folder. Then I had to use ctrl-a to select everything in the folder and move them manually to the current folder (such as inbox). Then I could use the other utility you mentioned to remove the duplicates. This had to be done, one folder at a time, to combine each folder. It worked, but I had about thirty-five folders to deal with. The whole process took most of two days to complete. I wish there was a simple way to blend everything together in one action, but I could not find an add-on that would do this.
    Frank Simonie

  • How Can i Use two Different Public IP Addresses no my DMZ with ASA Firewall.

    How To Using Two Different Public IP Address on My DMZ with ASA 5520
    Postado por jorge decimo decimo em 28/Jan/2013 5:51:28
    Hi everyone out there.
    can any one please help me regarding this situation that im looking for a solution
    My old range of public ip address are finished, i mean (the 41.x.x.0 range)
    So now i still need to have in my DMZ another two servers that will bring some new services.
    Remember that those two server, will need to be accessable both from inside and from outside users (Internet users) as well.
    So as i said, my old range of public ip address is finished and we asked the ISP to gives some additional public
    ip address to address the need of the two new servers on DMZ. and the ISP gave us the range of 197.216.1.24/29
    So my quation is, on reall time world (on the equipment) how can i Use two different public ip address on the same DMZ
    on Cisco ASA 5520 v8??
    How my configuration should look like?
    I was told about implementing static nat with Sub Interfaces on both Router and ASA interface
    Can someone please do give me a help with a practical config sample please. i can as well be reached at [email protected]
    attached is my network diagram for a better understanding
    I thank every body in advance
    Jorge

    Hi,
    So looking at your picture you have the original public IP address range configured on the OUTSIDE and its used for NAT for different servers behind the ASA firewall.
    Now you have gotten a new public IP address range from the ISP and want to get it into use.
    How do you want to use this IP address range? You want to configure the public IP addresses directly on the servers or NAT them at the ASA and have private IP addresses on the actual servers (like it seems to be for the current server)?
    To get the routing working naturally the only thing needed between your Router and Firewall would be to have a static route for the new public network range pointing towards your ASA OUTSIDE IP address. The routing between your Router and the ISP core could either be handled with Static Routing or Dynamic Routing.
    So you dont really need to change the interface configuration between the Router and ASA at all. You just need a Static route pointing the new public IP address towards the ASA outside IP address.
    Now when the routing is handled between the ISP - ISP/Your Router - Your Firewall, you can then consider how to use those IP addresses.
    Do you want to use the public IP addresses DIRECTLY on the HOSTS behind the firewall?This would require you to either configure a new physical interface with the new public IP address range OR create a new subinterface with the new public IP addresses range AND then configure the LAN devices correspondingly to the chosen method on the firewall
    Do you want to use the public IP addresses DIRECLTY on the ASA OUTSIDE as NAT IP addresses?This would require for you to only start configuring Static NAT for the new servers between the inside/dmz and outside interface of the ASA. The format would be no different from the previous NAT configuration other than for the different IP addresses ofcourse
    Of the above ways
    The first way is good because the actual hosts will have the public IP addresses. Therefore you wont run into problems with DNS when the LAN users are trying to access the server.
    The second way is the one requiring the least amount of configurations/changes on the ASA. In this case though you might run into problem with DNS (to which I refer above) as the server actually has a private IP address but the public DNS might reply to the LAN hosts with a public IP address and therefore connections from LAN could fail. This is because LAN users cant connect to the servers OUTSIDE NAT IP address (unless you NAT the server to public IP address towards LAN also)
    Hopefully the above was helpfull. Naturally ask more specific questions and I'll answer them. Hopefully I didnt miss something. But please ask more
    I'm currently at Cisco Live! 2013 London so in the "worst case" I might be able to answer on the weekend at earliest.
    - Jouni

  • How can I use two accounts ?

    How can I use two accounts (mine and my wife's) to PhotoStream to my mac? I have to turn off photo stream for one or the other...can't I just leave two accounts logged on so that the photos from my iphone and hers both go to my mac?

    Photostreaming across machines requires to use the same Apple-ID on all of these machines or devices. Share all of iclouds account stuff or nothing at all . No way around as icloud is designed that way. Photostream is not designed as a sort of gallery to share with outsiders. It is for your personal entertainment .

  • How can i use Unix database in java?

    How can i use Unix database in Java?
    Message was edited by:
    JPro

    I have not a clue about FoxPro, but the db then is FoxPro and not Unix. The better question would be "How do I connect to FoxPro DB running on Unix with JDBC?".
    My answer to that would be, search the Internet for a JDBC driver.

  • How can I use two monitors to increase workspace?

    how can I use two monitors to increase workspace?

    Drag the tabs of any After Effects windows you want to the second monitor.

  • How can we use two BOM

    Dear all,
    my scenario is in this way way-
    how can we use two BOM for same material.first BOM for inhouse production. Second one for Subcontracting.(means i have to create Purchase order for partial qty.

    Dear
    1.Goto MM02-MRP4 view -Maintain two Production Version based on two BOM ( Alternative1 with Routing will be PV1 will be used for production in house  where as Alt2 with routing having PP03 as control key for external operation -PV2 )
    2.Assign the relavant production Version-PV2 in Subcontracting Info Record in ME11
    Now, based on the production version assigned in Info Record system suggests the BOM while BOM explosion in Subcon Purchase Order
    REFER : Subcontracting & BOM  alternative
    Hope this will solve your issue
    Regards
    JH
    Edited by: Jiaul Haque on Sep 29, 2010 1:27 PM

  • How can i use diffrent database for same file in same project?

    I want to use two database. First normal environment, second for budget. Second copy from first environment. For example 1. database name = "MRP" , 2. database name = "MRPBUDGET".When program is start, users can select database. My question how can i use which selected database name in program.
    Thanks a lot for your help,

    Hi giri,
    I test it. When i change
    cocukRowSet.setDataSourceName("java:comp/env/jdbc/mysql_dogum");
    cocukRowSet.setDataSourceName("java:comp/env/jdbc/mysql_dogum1");
    in SessionBean1.java
    i run it. But this page of project is open explorer it didn't change sun-web.xml and web.xml in projetct directory(line
    <resource-ref>
    <res-ref-name>jdbc/mysql_dogum</res-ref-name>
    <jndi-name>jdbc/mysql_dogum</jndi-name>
    </resource-ref>
    When i close this page of project from explorer , i clean and build project and then find in project "dogum1", i saw true value in sun-web.xml and web.xml. Project is running true.
    How can i change xml file when project running. Can i use drop down list for database name(which change run time)
    Thanks,

  • How can I use two different Yahoo mail accounts ion Firefox?

    I have two Yahoo mail IDs. How can I use them both simultaneously on Firefox? Right now I am running Firefox and Internet Explorer so I can have the two accounts open at the same time. I would prefer to have both accounts running on Firefox, but I can't figure out how to do it.

    Multifox is an extension that allows Firefox to connect to websites using different user names. Simultaneously! <br />
    http://br.mozdev.org/multifox/

  • How can I use two displays with my Mac Mini?

    How can I connect two displays to my Mac Mini (newest generation with one thunderbold and one hdmi)?

    Have you tried connecting one to the HDMI output, and another to the Thunderbolt port (with the appropriate Mini DisplayPort-to-other connection adapter as needed)?

  • How can I use two differant iphones on one itunes

    I can i use two differant iphones on one itunes, and keep the content seperate?

    You can sync as many iphones/ipod/ipads as you like to one computer.
    Each is different and is recognized as such

  • How can I use two Airport Express N's together

    I have just purchased the new airport express n and I have the one that I am currently using which is also an n.
    How can I use both at the same time as part of the same network?

    If your goal is to extend the wireless range of one AirPort with another, check out this Apple Support article.

  • How can i compare two databases and their tables

    i have a text.txt file then
    i will insert it into db_header and db_details
    db_header has tbl_pcountheader with fld_Rack_No(char) PK and fld_DateAdded(date) PK
    db_details has tbl_pcountdetails with fld_Rack_No(char) PK, fld_Barcode(char) PK and fld_Quantity(int)
    then i will lookup in db_products
    db_products has tbl_products and tbl_barcodes
    tbl_products has fld_ItemCode
    tbl_barcodes has fld_Barcode and fld_ItemCode
    now i want to make a prompt contains
    Rack No: Date:
    Counter No:
    Barcode | Item Code | Item Description | Quantity
    how can i fill up this by comparing db_details and db_products?
    Private Sub bt_upload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_upload.Click
    If saveCheckBox.Checked = False Then
    MsgBox("Please click the box to continue.")
    Return
    End If
    If lb_file.SelectedItem Is Nothing Then
    MessageBox.Show("Please select a file.")
    Exit Sub
    End If
    ' Obtain the file path from the list box selection.
    Dim filePath = lb_file.SelectedItem.ToString
    ' Verify that the file was not removed since the Browse button was clicked.
    If System.IO.File.Exists(filePath) = False Then
    MessageBox.Show("File Not Found: " & filePath)
    Exit Sub
    End If
    ' Obtain file information in a string.
    Dim fileInfoText As String = GetTextForOutput(filePath)
    'LookUP db_header, db_details and db_products
    Dim cs As String = "Database=;Data Source=localhost;" _
    & "User Id=root;Password=1234"
    Dim conn As New MySqlConnection(cs)
    Dim ds As New DataSet
    Dim da As New MySqlDataAdapter
    Dim cmd As New MySqlCommand
    Dim dt As New DataTable
    Dim stm As String = "SELECT tbl_pcountheader.fld_Rack_No, tbl_pcountheader.fld_DateAdded, tbl_pcountdetails.fld_Barcode, tbl_products.fld_ItemCode, tbl_products.fld_ItemDesc, tbl_pcountdetails.fld_Quantity FROM db_header.tbl_pcountheader INNER JOIN db_details.tbl_pcountdetails ON db_details.tbl_pcountdetails.fld_Rack_No = db_header.tbl_pcountheader.fld_Rack_No INNER JOIN db_products.tbl_barcodes ON db_details.tbl_pcountdetails.fld_Barcode = db_products.tbl_barcodes.fld_Barcode INNER JOIN db_products.tbl_products ON db_products.tbl_barcodes.fld_ItemCode_fk = db_products.tbl_products.fld_ItemCode GROUP BY tbl_pcountheader.fld_Rack_No, tbl_pcountheader.fld_DateAdded ORDER BY tbl_pcountheader.fld_Rack_No"
    ds = New DataSet
    Try
    conn.Open()
    da = New MySqlDataAdapter(stm, conn)
    da.Fill(ds, "tbl_pcountheader")
    DataGridView1.DataSource = ds.Tables("tbl_pcountheader")
    Dim headers = (From header As DataGridViewColumn In DataGridView1.Columns.Cast(Of DataGridViewColumn)() _
    Select header.HeaderText).ToArray
    Dim rows = From row As DataGridViewRow In DataGridView1.Rows.Cast(Of DataGridViewRow)() _
    Where Not row.IsNewRow _
    Select Array.ConvertAll(row.Cells.Cast(Of DataGridViewCell).ToArray, Function(c) If(c.Value IsNot Nothing, c.Value.ToString, ""))
    Using sw As New IO.StreamWriter("c:\report.txt", append:=True)
    sw.WriteLine(String.Join(",", headers))
    For Each r In rows
    sw.WriteLine(String.Join(",", r))
    Next
    End Using
    ds.WriteXmlSchema("Sample.xml")
    Dim cr As New CrystalReport1()
    cr.SetDataSource(ds)
    CrystalReportviewer1.ReportSource = cr
    CrystalReportviewer1.Refresh()
    Catch ex As MySqlException
    MsgBox("Error: " & ex.ToString())
    Finally
    conn.Close()
    End Try
    ' Show the file information.
    Dim PrintPrompt As String
    PrintPrompt = MsgBox(fileInfoText, MsgBoxStyle.YesNo, "ProofList")
    If PrintPrompt = vbYes Then
    'fileInfoText.print()
    If saveCheckBox.Checked = True Then
    ' Place the log file in the same folder as the examined file.
    Dim bakFolder As String = System.IO.Path.GetDirectoryName(filePath)
    Dim bakFilePath = System.IO.Path.Combine(bakFolder, "back-up.bak")
    Dim bakText As String = "Backed-Up: " & Date.Now.ToString & vbCrLf & fileInfoText & vbCrLf & vbCrLf
    ' Append text to the log file.
    'System.IO.File.AppendAllText(bakFilePath, bakText)
    My.Computer.FileSystem.WriteAllText(bakFilePath, bakText, append:=True)
    'My.Computer.Network.UploadFile(bakFilePath, "C:\Documents and Settings\SAPC-TECH\My Documents\back-up file.bak", "", "", False, 1000)
    'My.Computer.FileSystem.DeleteFile(bakFilePath)
    'Form2.Show()
    End If
    'Note: This message box shows that you've uploaded a file and back up it.
    MessageBox.Show("Already backed-up to ")
    Else
    'Me.Close()
    'Application.Exit()
    'End
    End If
    'Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
    'Form2.Close()
    'Me.Close()
    End Sub
    here's my final code that solves my problem.
    i just make the environment of vb into mysql console
    so that i can call all the database that i wanted.

    Private Sub bt_upload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_upload.Click
    If saveCheckBox.Checked = False Then
    MsgBox("Please click the box to continue.")
    Return
    End If
    If lb_file.SelectedItem Is Nothing Then
    MessageBox.Show("Please select a file.")
    Exit Sub
    End If
    ' Obtain the file path from the list box selection.
    Dim filePath = lb_file.SelectedItem.ToString
    ' Verify that the file was not removed since the Browse button was clicked.
    If System.IO.File.Exists(filePath) = False Then
    MessageBox.Show("File Not Found: " & filePath)
    Exit Sub
    End If
    ' Obtain file information in a string.
    Dim fileInfoText As String = GetTextForOutput(filePath)
    'LookUP comparison db_details to db_products
    'Dim connString As String = "Database=db_products;Data Source=localhost;" & "User Id=root;Password=1234"
    'Dim conn As New MySqlConnection(connString)
    'Dim cmd As New MySqlCommand()
    'Try
    ' conn.Open()
    ' cmd.Connection = conn
    ' cmd.CommandText = "SELECT Database1.dbo.TableName.ColumnName, Database2TableName.Name, 'The reason why Database 2 isnt defined is the fact that it has been defined in the connection" _
    ' FROM Database2TableName INNER JOIN _
    ' Database2TableName2 INNER JOIN _
    ' WHERE (Database1.dbo.TableName.ColumnName = '')"
    ' cmd.Prepare()
    ' cmd.ExecuteNonQuery()
    ' conn.Close()
    'Catch ex As Exception
    'End Try
    ' Show the file information.
    Dim PrintPrompt As String
    PrintPrompt = MsgBox(fileInfoText, MsgBoxStyle.YesNo, "ProofList")
    If PrintPrompt = vbYes Then
    'fileInfoText.print()
    If saveCheckBox.Checked = True Then
    ' Place the log file in the same folder as the examined file.
    Dim bakFolder As String = System.IO.Path.GetDirectoryName(filePath)
    Dim bakFilePath = System.IO.Path.Combine(bakFolder, "back-up.bak")
    Dim bakText As String = "Backed-Up: " & Date.Now.ToString & vbCrLf & fileInfoText & vbCrLf & vbCrLf
    ' Append text to the log file.
    'System.IO.File.AppendAllText(bakFilePath, bakText)
    My.Computer.FileSystem.WriteAllText(bakFilePath, bakText, append:=True)
    'My.Computer.Network.UploadFile(bakFilePath, "C:\Documents and Settings\SAPC-TECH\My Documents\back-up file.bak", "", "", False, 1000)
    'My.Computer.FileSystem.DeleteFile(bakFilePath)
    Form2.Show()
    End If
    'Note: This message box shows that you've uploaded a file and back up it.
    MessageBox.Show("Already backed-up to ")
    Else
    Me.Close()
    Application.Exit()
    End
    End If
    Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
    Form2.Close()
    Me.Close()
    End Sub
    here's my code wherein i have to compare the two database and save it into .txt file
    i just have to get this items
    Rack No:
    Date:
    Counter No:
    Barcode:
    Item Code:
    Item Description:
    Quantity:
    as a prooflist to be print out.

  • How can I use two OID realms in an application in Jdev 10.1.2

    hello,
    We have an application in jdeveloper 10.1.2. We are using OID with jazn
    The users of the application are in two different realms. Right now, the application can se the users on the default realm of the OID to authenticate them, but cannot se the other realm (and the users of that realm).
    How can we do, to let the application be able to authenticate the users of the two realms.
    thanks

    Hi,
    The basics for using the two databases is simple.
    For database configuration you have to provide the driver class name, url, schema name and password during the creation of the connection pools. So u can create a as many no. of connection pools as the no. of the databases.
    Hope it will work..

Maybe you are looking for

  • Intercompany reconciliatin tool. Upload file

    Hello, We are testing intercompany reconciliation tool in process 003, customer and vendor open items. We are trying to upload a file in tc FBICS3, for intercompany reconciliation and we can’t upload a line with a negative amount. The file has the sa

  • Get weeks based on start date

    Hi , i need a query that will determine the weeks based on start date. if the table consists of: vDate vAmount 06/25/2007 100 06/27/2007 200 07/04/2007 400 If one enters start date as 6/25/2007 , amounts should be broken out in 7 day increments. Resu

  • RMAN archive logs backup and restore in RAC environment.

    Hello All, I have a 8 node RAC using ASM production database and a single node standby database using ASM. I have archive log gap on the standby database and the archive logs on the primary database is backed up and removed. I need to resync the stan

  • Req. delivery date is taking other date than system date in va01

    DEAR SAP GURUS , I am facing one porblem . when i am creating a sales order then in sales tab ( the very first tab ) in req. delivery date field it is picking other date than current system date . for example today (10.04.2009) i am creating a sales

  • Compiling the action function

    While compiling my java class I receive this error MyClassName.java:372: warning: action(java.awt.Event,java.lang.Object) in java.awt.Component has been deprecated public boolean action(Event e, Object arg) { How is this possible, I'm using examples