Can I do an insert with one column value being specified and the others being retrieved? Basically, I have to take an input from the user, join that input with the result of a select (based on that input) and post that to a table
I don’t suppose we can do something like
Hi,I have a button that that executes insertion of data into a database. For the data it inserts into one column, the data is located in another database table.As well as this being inserted, I would like more data to be inserted in the same column, which comes from textboxes which are located on the same page as the button that executes the insertion..For example: someone types in information into textboxes, then presses the button. The code behind then inserts the data from the textboxes plus the data from the other table (for which the coding is already done).Here is my current code: public bool [snip](int ProductId) {[snip] command.CommandText = "INSERT INTO Messages (sendername,recievername,message,senddate,subject) VALUES (@sendername,@recievername,@message,@date,@subject)"; command.Parameters.AddWithValue("@sendername", System.Web.HttpContext.Current.User.Identity.Name); DataView dv = SqlDataSource2.Select(DataSourceSelectArguments.Empty) as DataView; string receivername = " " + dv[0]["Usersname"].ToString() + " "; command.Parameters.AddWithValue("@recievername", receivername); DataView dv2 = SqlDataSource3.Select(DataSourceSelectArguments.Empty) as DataView; string message = dv2[0]["paymentinstructions"].ToString(); command.Parameters.AddWithValue("@message", message); command.Parameters.AddWithValue("@subject", TextBox1.Text); command.Parameters.AddWithValue("@date", DateTime.Now); command.ExecuteNonQuery(); con.Close(); command.Dispose(); return true; } So along with "paymentinstructions" being inserted into 'message', I would also like the values from TextBox4, TextBox5 and TextBox6 to be inserted... It would also be good if text could be inserted infront of the values of these textboxes - e.g. Price: "TextBox4's value"Does anyone have any ideas? Reply if it needs further explanation.Thanks,Jon
I am trying to insert values in a single table with four columns from 4 different sources. is it possible to run these 4 insertions in parallel. all these insertion are independent of each other
Hi i have data on a Server in a different database which i like to access from within my ssis job.
I just need to look up information from one table on this database so i can references it. Is there a way of doing this is SSIS. Rather then me having to load the data from one database to another as the data may change.
i tried having 2 sources of data feed into a look up but that does not work..
On my home page I have several different folders to reports which require different data sources. the problem is that within these folders there are multiple copies of the same datasource. is it possible to store all of the datasources in one folder, one location? it would certainly be easier when changes to usernames and passwords need to be modified!
I have around 120 tables. I am using script component to pull the values from oracle stored procedures. I do not want to create 120 source & desitinations in my dataflow. Please advice how can this be possible with one script component and one oledb destination.
I noticed I can add mutiple outputs in 1 script component which makes the script component to work like a dataset (container of different recordsets (tables) ), if I am correct. Can this be redirected to an dynamic oledb connection.
I searched and read about Data Sources and I'm seeing that there is no advantage in using it, which is what I found from playing around with it.
I expected that you would set a global connection in Data Sources and somehow link this to the things in your Connection Manager, giving you one place to switch from one environment to another. But reading the discussions here and playing around with it, this is not the case.
So, why is it there?
Next question.... another thing I gathered so far is something called "Configurations" that will do what I was describing above. Where do I do this?
I'm trying to combine two reports I've created into a form letter. The goal is to have a letter that indicates the students maximum UBSCT score for Math, Reading and Writing. Also in the letter we want to include the student's total number of credits awarded and overall GPA. I not sure if I need to try and combined the two queries or use two different data sources in Reporting Services. I've tried creating one sql statement but the grouping are giving me fits. I fairly new to Reporting Services.
Report 1:
704 Dixie High 11 311880 Student_1 UBSCT Math 176 704 Dixie High 11 311880 Student_1 UBSCT Reading 182 704 Dixie High 11 311880 Student_1 UBSCT Writing 173 704 Dixie High 11 311881 Student_2 UBSCT Math 168 704 Dixie High 11 311881 Student_2 UBSCT Reading 172 704 Dixie High 11 311881 Student_2 UBSCT Writing 165
SELECT track.schoolc as School_Code, school.schname as School, stustat.graden as Grade, studemo.ident as Ident, RTRIM(studemo.lastname) + ', ' + RTRIM(studemo.firstname) AS [Student], stutscors1.testc as Test_Code, left(zsubtest1.descript,20) as [Subject], max(stutscors1.testscore) as Score
FROM stutscors1 INNER JOIN stutests1 ON stutscors1.ststuniq = stutests1.ststuniq INNER JOIN studemo ON stutests1.suniq = studemo.suniq INNER JOIN stustat ON studemo.stuuniq = stustat.stuuniq INNER JOIN track ON stustat.trkuniq = track.trkuniq INNER JOIN school ON track.schoolc = school.schoolc INNER JOIN testdef1 ON stutests1.testuniq = testdef1.testuniq INNER JOIN zsubtest1 ON stutscors1.subtestc = zsubtest1.subtestc and stutscors1.testc = zsubtest1.testc
WHERE stutscors1.testscore <> ' ' and stutscors1.testscore <> '0' and school.schname = 'Dixie High'and stutscors1.testc = 'UBSCT' and stustat.graden = 11
GROUP BY track.schoolc, school.schname, studemo.ident, RTRIM(studemo.lastname) + ', ' + RTRIM(studemo.firstname), stustat.graden, stutscors1.testc, zsubtest1.descript
704 Dixie High 11 Student_1 311880 23.2500 23.2500 87.50300000 3.763569 704 Dixie High 11 Student_2 311881 20.2500 20.2500 76.84300000 3.794716
select stugrp_active.schoolc as School_Code, school.schname as School, stugrp_active.graden as Grade, rtrim(stugrp_active.lastname) + ', ' + rtrim(stugrp_active.firstname) as Student, trnscrpt.suniq as Ident, sum(trnscrpt.gpacratt) as CreditAtt, sum(trnscrpt.gradcrawd) as CreditAwd, round(sum(case when Trnscrpt.GpaCrAtt is null then 0 else Trnscrpt.GpaCrAtt end * gpamarks.gpavallvl0),3) AS TrmGpaPts, (round(sum(case when Trnscrpt.GpaCrAtt is null then 0 else Trnscrpt.GpaCrAtt end * gpamarks.gpavallvl0),3))/(sum(trnscrpt.gradcrawd)) as GPA
from dbo.trnscrpt inner join dbo.stugrp_active on (trnscrpt.suniq = stugrp_active.suniq) INNER JOIN school ON stugrp_active.schoolc = school.schoolc INNER JOIN gpamarks ON trnscrpt.marksetc1 = gpamarks.marksetc AND trnscrpt.markawd1 = gpamarks.mark
where school.schname = 'Dixie High' and stugrp_active.graden = 11 and trnscrpt.graden >= 9
group by stugrp_active.schoolc, school.schname, stugrp_active.graden, rtrim(stugrp_active.lastname) + ', ' + rtrim(stugrp_active.firstname), trnscrpt.suniq
In brief, here is my quandary… I have a GridView on a page with some radio buttons, a couple of check boxes, some drop downs etc. And depending on what the user selects the Grid View needs to show different columns from the database… The easiest way I have found to do this is to have a separate Data Object for each “view�, i.e. each variation of the checkboxes and radio buttons (which determine which dropdowns to use for the variables) and then bind the GridView to the specific Data Source at runtime…
It seemed like a good idea at the time, but now I have over 7 different data connections cluttering up the design view, and more to come and I feel like I am missing a better way to achieve the same results…
Does anyone have some advice for a major novice?
Here’s the beginning of a large set of nested ifs, if this is the way it’s done that’s fine too, I’ll just keep creating data sources, I just get the feeling there must be an easier way to do this..
I'm just wondering if it is bad programming practice to have many data sources on one page. I need a "Matrix" type of page that grabs data from many tables and so far I have 5 data sources. Is this common or is there something I should be doing to make it more efficient?
Can I import in my query a file from other sources (in this case it's a job that has elaborated server database data, but I could be in the need of using for instance Excel files or others) and compare its fields with the tables in my query?
Hello Friends, I need suggestion/help I have to build a package using SSIS and the requirement is like this, First I have to check the data source type(3 types for now) then I have to select a query for each different source from a table (basically the connection string and query changes for each query) and load the data into the dimension and fact tables.
I am not able to get the full picture of how I am going to achieve this, there is little complication to this one of the 3 sources has 15 servers from where i have to extract data Hope I am clear enough
I have a vb program that calls a sp. My vb program connects to DataSource1, Catalog1 and to DataSource2, Catalog2. My sp resides in Catalog1 using a table from catalog1 and a table from catalog2.
I have different files that are sent from our vendors. Some are TXT and some are XLS. Some will have the same structure. I plan on grouping these together as best as I can.
My main problem is that I would like to go from one source that matches a group of files to a single SQL table. I'm still learning about SSIS and its capabilities. If I can get pointed in the right direction or have an example to work from, that would be great.
I've tried googl'ing to find some step by step, examples, and hints to do this right, but so far I'm at a bit of an impasse.
If I were to change a data source that many packages use (say, from box "SQL-2" to "SQL-1"), would I have to re-upload the packages that used that data source? Or would the packages already on the server receive that change somehow?
(currently realizing that most of the packages use package-local data connections instead of project-wide data sources...)
OK I have 4 differant Data Sources... One being a count of one DB, another count of another DB, another count of another and then another process from a script component. Each source returns 1 row of data with 1 column each except the Script Component. It returns 3 columns... Now I need to take each of the row's returned and combine them to a single row (line) and inset them into another table just as one single eatry. I am using a Union All and when it runs I see the 4 Data Sources say 1 Row... But after it hits the Union All it does 4 rows... What am I doing wrong or am I using the wrong component? Please if anyone can help that would be wonderful.
I am working on a typical data conversion project where we are migrating data from an old data model to a new data model, using SSIS. Both the DBs are in SQL.
Now we have a situation where say there are 25 source tables and 20 odd target tables.
For transporting data, we are using OLEDB Source & OLEDB Destination transforms. However, each transform maps to one view or one table. As a result, the Data Flow is really messed up with 45+ transforms in it. Is there an elegant way of doing this ? With say just one datasource or maybe fewer transforms?
I'm trying to create a merge between 2 tables, the first coming from Oracle and the second resident on SQL 2005. The result I'd like to retrieve would be a table composed from the original data contained in the SQL table, update with new or changed rows coming from Oracle (the 2 tables are identical, I'm building an update job..). The final table will be the same table used for data source.
I setup connections and everything seems to works, but when I link the Merge block with the 2 sources blocks, double clickin on the Merge Block, I notice that every SQL table's column is set to "ignore". When I try to change it, SSiS says:
Failed to set property "OutputColumnLineageID" on input column ...
What's wrong? I've set IsSorted property to True and each column with the righ position...
I've also another question: actually my tables hasn't a "last update" column, so I think the merge "block" can't just update the SQL existing rows but it will add only newest rows. Is that right? How can I easily implement an "update check" in your opinion?
I'm thinking aboug using Service Broker to aggregate transactions from 12 remote SQL Servers to a central SQL Server. Service Broker is new to me, so I don't know what the proper setup would be.
We have five different kinds of transactions that can be sent from any of the remote servers. These remote servers truly are remote, connecting to the central server over a WAN. We don't want problems with one server to interfere with any other server. We also don't want problems with one kind of transaction to interfere with the processing of any other kind of transaction.
If were only talking about one remote server, I'm guessing I'd want to create 5 different services - one for each kind of transaction. Does that mean I'd also need to create 5 different routes on both the remote server and the central server?
And how would I scale this out to a dozen remote servers? Can I stick with 5 services on the central server, or would I need to define 5 different services for each remote server, so 60 total? And would that be 60 different routes defined on the central server? Based on my limited knowledge of routes and how they're tied to services, I think that would mean 60 routes, but maybe I'm missing something.
I'm coming from ASP and I used to have a global connection string accessible to all of my ASP pages that I'd use for all of my data access. This was really convenient because I could easily switch to a backup or local data source for testing/debug by changing the connection string in one place.
Now, I'm using ASP.NET with Web Matrix and I love the drag and drop functionality but its dropping my connection string all over the place. How can I do this and keep my connection string in one spot so I can have the same convenience of switching data sources.
I am using SQL Server 2012, and I have a query that gets data from 4 different sources and sums them all up into one field to get a total, and right now I am using 4 queries for each data source and using UNION ALLs to combine them and I was wondering if there is a different way to accomplish this without using UNION statements.Here is a sample of my code.
SELECT Resv01 = ISNULL(SUM(Resv01),0) FROM ( SELECT Resv01 = SUM(Reservations)
Hello, I have a datagridview setup right now to display data from one table in my database. However, I am going to need it to pull certain columns from certain tables and put them all into one datagrid. The three tables are demographics, financial, and procedures. Can someone give me an example on how I'd go about doing this? I'm using vb.net.
The procedures table is a list of options that will be displayed in a combo box, depending on the option selected, other cells in the datagrid will be filled with certain data, this data is in the procedures table as well. All of this data will be alongside a customer id located in the demographics table, and will all be recorded into the financial table.
I'm using Microsoft DB2 OLE DB Driver to access a DB2 database, and I have a problem when I create an OLE DB Source using a parameterized query. Everytime I push the "Parameters" button, I get this error:
TITLE: Microsoft Visual Studio ------------------------------
Parameters cannot be extracted from the SQL command. The provider might not help to parse parameter information from the command. In that case, use the "SQL command from variable" access mode, in which the entire SQL command is stored in a variable.
I have to get all the customer records from one table and compare this records with another table and finally if there is same record I have to perform an update but the record does not exist I have to make an insert. How can I do it with SSIS Except writing sql or tsql scripts ?
I want to configure a Data Source and then Deploy the Data Source and Data Source view along with several packages that use connection managers based on the Data Source/Data Source Views.