Using Join To Match Transactions To Client Data
Apr 10, 2001
I am running SQL2k on Win2k sp1. I need to match a transaction record (using txn_date) to client data as it would have appeared on the date of the transaction (using client_last_update).
A new row is inserted into my client table every time any part of the clients information changes, thereby leaving the change history in tact. The client_last_update field holds the date the change took place. It is required that the user be provided the client information that was current on the day of the transaction.
Example: A client record (name, address, accountno) was inserted to the client table on 2/1/2000 (the last_update field is empty because it's a new record).
The client record is modified on 4/15/2000 for a name change (making the last_update = 4/15/2000), and again on 12/5/2000 (making the last_update = 12/5/2000).
Transactions are made by the client on 2/5/2000, 6/10/2000, and 3/25/2001. These dates are held in the txn_date field in the transaction table.
The client now has 3 transaction records in the transaction table for his/her account number and 3 client records in the client table.
The transaction on 2/5/2000 should be joined to the initial client record ((2/5/2000 > empty) AND (2/5/2000 < 4/15/2000))
The transaction on 6/10/2000 should be joined to the client record having the last_update = 4/15/2000 (6/10/2000 > 4/15/2000) AND (6/10/2000 < 12/5/2000))
The last transaction, executed on 3/25/2001 should be joined to the most current client record, which has last_update = 12/5/2000 (3/25/2001 > 12/5/2000).
I have been experimenting with the code below, and found it to only return client data where the client record update_date = '4/18/2000'.
select * from transaction t Left Outer Join client c On t.SEC_ACCT = c.Account_No and t.Txn_Date > coalesce(c.Last_Update_Date, '1/1/1900') and t.Txn_Date < (select min(c2.Last_Update_Date) from client c2 where c2.Last_Update_Date > coalesce(c.Last_Update_Date, '1/1/1900'))
An example of a record that DID get returned carried a txn_date of '1/2/2001', and possible client update_dates of: NULL, '5/13/1999', and '4/18/2000'. The row returned carried a client update_date of '4/18/2001', and rightly so.
An example of a record that DID NOT get returned carried a txn_date = '1/2/2001' and possible client update_dates of: NULL, and '6/11/1999. This row was not returned.
View 1 Replies
ADVERTISEMENT
Dec 5, 2007
I have transaction table I am pulling transactions from and can't quite figure out how to get a sum based on a few items.
I am trying to figure out how to show the sum of the InvestorAssumption and group it based on the DealId, then DealTransType and show the sum of the InvestorAssumption.
So I want to see a total of the InvestorAssumption by quarter split up by DealTransType, then DealId.
Not sure how to do this and any help would be greatly appreciated.
Here is my current view.
Code:
SELECT TOP 100 PERCENT dbo.DealTransactions.DealTransId, dbo.DealTransactions.DealId, dbo.DSGvwInvestorPercentage.InvestorID, DATEADD(quarter,
DATEDIFF(quarter, 0, dbo.DealTransactions.DealTransDate), 0) AS TransDateQuart, dbo.DealTransactions.DealTransType,
dbo.DealTransTypes.DealTransTypeName AS TransactionType, dbo.DealTransactions.DealTransAmount,
dbo.DSGvwInvestorPercentage.InvestorPercentage * dbo.DealTransactions.DealTransAmount / 100 AS InvestorAssumption,
dbo.DSGvwInvestorPercentage.InvestorPercentage, dbo.DealTransactions.DealTransDate AS TransDateActual
FROM dbo.DealTransactions INNER JOIN
dbo.DSGvwInvestorPercentage ON dbo.DealTransactions.DealId = dbo.DSGvwInvestorPercentage.DealID INNER JOIN
dbo.DealTransTypes ON dbo.DealTransactions.DealTransType = dbo.DealTransTypes.DealTransTypeId
GROUP BY dbo.DealTransTypes.DealTransTypeName, dbo.DealTransactions.DealTransAmount, dbo.DealTransactions.DealId,
dbo.DSGvwInvestorPercentage.InvestorID, dbo.DSGvwInvestorPercentage.InvestorPercentage * dbo.DealTransactions.DealTransAmount / 100,
dbo.DealTransactions.DealTransType, dbo.DSGvwInvestorPercentage.InvestorPercentage, dbo.DealTransactions.DealTransId,
dbo.DealTransactions.DealTransDate
ORDER BY dbo.DealTransactions.DealId, dbo.DSGvwInvestorPercentage.InvestorID, dbo.DealTransTypes.DealTransTypeName,
dbo.DealTransactions.DealTransAmount
View 1 Replies
View Related
Jan 2, 2007
If the mirror server goes down for any reason, then what happens to client transactions against the principle?
Will any client transactions fail?
Thanks in advance
View 3 Replies
View Related
Mar 23, 2006
Hi there.
With Client-Side Redirect, connections can be dinamically redirected in case of failover. But if a long transaction is running on the principal, when it fails the redirect doesn´t work with the current ado.net connection, connected to the database running that transaction.
So if the principal fails, current running transaction will be lost right ?
Thanks in advance.
View 1 Replies
View Related
Jun 16, 2015
I have a view where I am joining two very large tables.
I am joining where Brand and then Product match.
My problem is that there are quite a few rows where there is a Brand and Product in Table A but it is not in Table B and the other way around, Products in B that aren't in A and I need ALL of the products to show, not just the ones that are in both tables.
The field names are the same in each table, one is North America and the other is Europe. HOW do I write that?
SELECT
dbo.SummaryNA.Brand,
dbo.SummaryNA.Product,
dbo.SummaryEU.Brand AS Expr1,
dbo.SummaryEU.Product AS Expr2,
dbo.SummaryNA.Supplier,
[Code] ....
View 4 Replies
View Related
Nov 30, 2004
I have 2 tables GLSUMMARY and GLBUDGET, they are identical.
I am joining them together with a left outer join from the SUMMARY to the BUDGET but when I dont have a matching BUDGET record on the join the SUMMARY gets dropped as well :eek:
Any help will be appreciated!
Here is the query!
SELECT s.conu as CoNu, s.deptnu as DeptNu,
s.fundnu as FundNu, s.acctnu as AcctNu,
Sum(isNull(Amt01,0)) as Amt01,
Sum(isNull(Amt02,0)) as Amt02,
Sum(isNull(Amt03,0)) as Amt03,
Sum(isNull(Amt04,0)) as Amt04,
Sum(isNull(Amt05,0)) as Amt05,
Sum(isNull(Amt06,0)) as Amt06,
Sum(isNull(Amt07,0)) as Amt07,
Sum(isNull(Amt08,0)) as Amt08,
Sum(isNull(Amt09,0)) as Amt09,
Sum(isNull(Amt10,0)) as Amt10,
Sum(isNull(Amt11,0)) as Amt11,
Sum(isNull(Amt12,0)) as Amt12,
Sum(isNull(Amt13,0)) as Amt13,
Sum(isNull(Bud01,0)) as Bud01,
Sum(isNull(Bud02,0)) as Bud02,
Sum(isNull(Bud03,0)) as Bud03,
Sum(isNull(Bud04,0)) as Bud04,
Sum(isNull(Bud05,0)) as Bud05,
Sum(isNull(Bud06,0)) as Bud06,
Sum(isNull(Bud07,0)) as Bud07,
Sum(isNull(Bud08,0)) as Bud08,
Sum(isNull(Bud09,0)) as Bud09,
Sum(isNull(Bud10,0)) as Bud10,
Sum(isNull(Bud11,0)) as Bud11,
Sum(isNull(Bud12,0)) as Bud12,
Sum(isNull(Bud13,0)) as Bud13
FROM shelbydb.shelby.GLSummary S
left OUTER JOIN shelbydb.shelby.GLBudget B
on
(s.begindate = b.begindate)
and (s.acctnu = b.acctnu)
and (s.conu = b.conu)
and (s.deptnu = b.deptnu)
and (s.fundNu = b.fundNu)
WHERE
(s.begindate = '1/1/2004'
and b.begindate = '1/1/2004')
group by
S.conu, S.deptnu, S.fundnu, S.acctnu,
b.conu, b.deptnu, b.fundnu, b.acctnu
View 3 Replies
View Related
Oct 12, 2015
I want to join 2 tables, table a and table b where b is a lookup table by left outer join. my question is how can i generate a flag that show whether match or not match the join condition ?
**The lookup table b for column id and country are always not null values, and both of them are the keys to join table a. This is because same id and country can have multiples rows in table a due to update date and posting date fields.
example table a
id country area
1 China Asia
2 Thailand Asia
3 Jamaica SouthAmerica
4 Japan Asia
example table b
id country area
1 China Asia
2 Thailand SouthEastAsia
3 Jamaica SouthAmerica
5 USA America
Expected output
id country area Match
1 China Asia Y
2 Thailand SouthEastAsia Y
3 Jamaica SouthAmerica Y
4 Japan Asia N
View 3 Replies
View Related
May 11, 2006
I have a flatfile source with qty,title and author..i add a lookup and in that i establish relation between title and titel of pubs database..but i am getting an error..
one or more columns do not hav supported data types,or their datatypes do not match..i checked both hav dt_str,and in database pubs title is varchr..so why this eror?
View 3 Replies
View Related
Nov 18, 2005
I have a table that stores part numbers and manufactuers. Somehow this table has become corrupt showing different manufacturers with the same part numbers.
I know this will take a bit of manual digging to fix, but I want to find a way to pull all rows that have the same part number that have different manufacturers, or just pull up any "duplicate" part numbers and I can determine what is right or wrong as far as the manufactuers and make those changes.
I have tried this, but it does not seem to want to work.
Code:
Select * from my_table
Where partnumber = (select partnumber from my_table) and compName <> (select compName from my_table)
I have tried other variations of the same, but nothing seems to want to show me just the items that have the same part numnbers and different manufacturers. I do not care if there are duplicates of the same part number/manufacturer entries, just if the part number is duplicated where the manufacturers are not the same.
These are the rows I want to edit and group by part number. I have almost a million rows of entries and this is not something I want to go through row by row. :-P
Any ideas?
View 2 Replies
View Related
Dec 6, 2007
I have discovered an instance where the Y-AXIS displays a scale incorrectly. The scale values that are displayed do not match the data points shown on the chart itself. I am not using any Minimum or Maximum values in the properties y-axis tab. This does not occur on all charts and seems to be random.
Has anyone encountered this before? Is this a bug in SSRS 2005? Does anyone know of a fix? All sugestions are welcome, thankx!
View 9 Replies
View Related
Aug 1, 2007
Could anyone help of how to match the exact characters in a data field in SQL 2005 Developer.
For example, if one has a password "GooD", then when he or she enters "GOOD", "good", etc, the database will not match the password. And he or she must enter the exact characters, which is "GooD".
Thanks.
View 2 Replies
View Related
Aug 1, 2007
Could anyone help of how to match the exact characters in a data field in SQL 2005 Developer.
For example, if one has a password "GooD", then when he or she enters "GOOD", "good", etc, the database will not match the password. And he or she must enter the exact characters, which is "GooD".
Thanks.
View 3 Replies
View Related
Apr 12, 2007
Need some quick help here.. The data I got from the text file use the "04/11/2007" date format and the StockDate in MS-SQL use the datetime datatype.
My understanding is that the "04/11/2007" will default to the 04/11/2007 12:00 am" format in MS-SQL.
So, when I use the sql query, how do search only for the date part of the data in MS-SQL and match it to the data from text file? I tried this SQL Query below.
--snip--
SELECT RawID FROM tblPurchaseRaw WHERE VIN = '" & sVin.ToString.Trim & "' AND StockDate = '" & dStockDate.ToString.Trim & "'
--snip--
That way, if I get a row then I know the data is there. If I don't get a row then I know the data is not there.
Bold: I get it now. It is all automatic as MS-SQL does it automatically...
View 5 Replies
View Related
Mar 1, 2008
Sorry for the confusing subject. Here's what im doing:I have a table of products. Products have N categories andsubcategories. Right now its 4. But there could be more down theline so it needs to be extensible.So ive created a product table. Then a category table that has manycategories of products, of which a product can belong to N number ofthese categories. Finally a ProductCategory "match" table.This is pretty straigth forward. But im getting confused as to how towrite views/sprocs to pull out rows of products that list all theproducts categories as columns in a single query view.For example:lets say productId 1 is Cap'n Crunch cereal. It is in 3 categories:Cereal, Food for Kids, Crunchy food, and Boxed.So we have:Product----------------1 Capn CrunchCategories-----------------1 Cereal2 Food for Kids3 Crunchy food4 BoxedProductCategories------------------1 11 21 31 4How do I go about writing a query that returns a single result set fora view or data set (for use in a GridView control) where I would havethe following result:Product results---------------------------------ProductId ProductName Category 1 Category 2Category 3 Category N ...------------------------------------------------------------------------1 Capn Crunch Cereal Food for Kids Crunchy foodBoxedAm I just thinking about this all wrong? Sure seems like it.Cheers,Will
View 1 Replies
View Related
Sep 23, 2015
If I have an ACID-based SQL engine and I run a long-running transaction that changes a record at some point during the transaction, and at the same time it's running another transaction changes a record that the long running transaction has/will change/d, will they both complete or will one transaction fail? If they both complete who wins the final state of the record? The long running one or the other one? (is it based on when the transaction actually started "point in time" or is it specific to when the record was changed during the transaction "point in time"?)
View 5 Replies
View Related
May 22, 2005
Hi there,
I have decided to move all my transaction handling from asp.net to stored procedures in a SQL Server 2000 database. I know the database is capable of rolling back the transactions just like myTransaction.Rollback() in asp.net. But what about exceptions? In asp.net, I am used to doing the following:
<code>Try 'execute commands myTransaction.Commit()Catch ex As Exception Response.Write(ex.Message) myTransaction.Rollback()End Try</code>Will the database inform me of any exceptions (and their messages)? Do I need to put anything explicit in my stored procedure other than rollback transaction?
Any help is greatly appreciated
View 3 Replies
View Related
Jun 15, 2015
I have a database that has entries that I want sorted by date order. Each entry has an auto ID number allocated (primary key auto sequencing), which I want to change to reflect the sorting (so the first date has the first auto ID number and so on).I've gone into the database and sorted the entries as I want them. Then I've gone into Design View to delete and restablish the primary key autosequence. However, it is not keeping the date order in the database (ie entry ID 3140 date is 12/06/2015, but 3141 is 02/02/2012). How do I get it to maintain the order?
View 3 Replies
View Related
Jun 22, 2015
I'm executing a stored procedure but got error :
Msg 213, Level 16, State 1, Procedure ExtSales, Line 182
Column name or number of supplied values does not match table definition.
View 5 Replies
View Related
Sep 3, 2015
Multi user ASP.Net website, SQL Server backend.When using transactions to insert multiple rows into a table and then commiting them once you're happy that everything looks good, the table(s) gets locked before commiting.Basically, I want to perform updates and inserts under a transaction but still allow other users to carry on using the site and potentially the tables that are being used with the transaction.
Question:Â Is there a way to stop the table lock occurring and for SQL to just do a record lock?, thus avoiding blocking other users?I know that a possibility is to use Snapshot replication, but am a little worried about turning it on due to the small team we have for testing.
View 10 Replies
View Related
Oct 20, 2007
Hi,
I´m exporting an ms-excel file, then I use a lookup transformation to get a field from a SQL Server 2005 table. The Lookup transformation editor, after selecting the table, shows a warning that says:
at least one mapping between a column from available input columns ans a column from available lookup columns must be defined on the columns page.
So I try to make a relationship in the Lookup transformation editor's column tab where I find the Available input columns and the available lookup columns but I get the following error:
The following columns cannot be mapped:
[Department, DEP_CLEGALCODE]
One or more columns do not have supported data types, or their data types do not match.
The field in SLQ Server is varchar(10) and the input field is a derived column transformation; I have tried different Data Types but I always have the same error.
The DataFlow is: ExcelSource --> Derived Column --> Lookup --> Flat file destination
thanks.
View 6 Replies
View Related
Jun 28, 2006
Hi,
I have a common requirement in numerous SSIS processes to take my main input data set and to remove all rows from it that match a second input data set on a given key and output this as the main output. I also want to output (as a second output) all the rows from the main input data set that did match on the given key. However, I don't want to merge in data from the second input, nor am I interested in rows from the second input data set that have no match in the main input.
E.g. If I have the following data:
Main input:
Key Name
--- ----
1 Steve
2 Jamie
3 Donald
Second Input
Key DontCareAboutThisField1
--- -----------------------
1 ...
3 ...
4 ...
Then I would like the following output:
Main Output
Key Name
--- ----
2 Jamie
Second Output
Key Name
--- ----
1 Steve
3 Donald
Can I do this with a standard transform, or will I have to write my own? Any help on this would be greatly appreciated!
Thanks in advance,
Lawrie
View 1 Replies
View Related
Jul 23, 2005
I have a very long transaction that runs on the same database thatother users need to use for existing data. I don't care if they seedata from the transaction before it is done and am only using thetransaction because I need a way to roll it back if any errors happenduring the transaction. Unfortunately all tables affected in the longrunning transaction are completely locked and nobody else can accessany of the affected tables while it is running. I am using thetransaction isolation level of read uncommitted, which from my limitedunderstanding of isolation levels is the least strict. What can I do toprevent this from happening?Below is the output from sp_who2 and sp_lock while the process isrunning and another process is being blocked by it.SPID Status LoginHostName BlkBy DBName Command CPUTimeDiskIO LastBatch ProgramName SPID----- ------------------------------------------------------------------------------ ---------- ----------------- ---------------- ------- ------ ------------------------------------------ -----1 BACKGROUND sa. . NULL LAZY WRITER 0 006/09 15:42:52 12 sleeping sa. . NULL LOG WRITER 10 006/09 15:42:52 23 BACKGROUND sa. . master SIGNAL HANDLER 0 006/09 15:42:52 34 BACKGROUND sa. . NULL LOCK MONITOR 0 006/09 15:42:52 45 BACKGROUND sa. . master TASK MANAGER 0 506/09 15:42:52 56 BACKGROUND sa. . master TASK MANAGER 0 006/09 15:42:52 67 sleeping sa. . NULL CHECKPOINT SLEEP 0 1206/09 15:42:52 78 BACKGROUND sa. . master TASK MANAGER 0 206/09 15:42:52 89 BACKGROUND sa. . master TASK MANAGER 0 006/09 15:42:52 910 BACKGROUND sa. . master TASK MANAGER 0 006/09 15:42:52 1011 BACKGROUND sa. . master TASK MANAGER 0 106/09 15:42:52 1112 BACKGROUND sa. . master TASK MANAGER 0 006/09 15:42:52 1251 sleeping SUPERPABLOAdministratorSUPERPABLO . PM AWAITING COMMAND 1813307 06/09 16:10:34 .Net SqlClient Data Provider 5152 sleeping SUPERPABLOAdministratorSUPERPABLO 54 PM SELECT 30 506/09 16:10:16 .Net SqlClient Data Provider 5253 RUNNABLE SUPERPABLOAdministratorSUPERPABLO . master SELECT 0 306/09 16:09:44 SQL Profiler 5354 RUNNABLE SUPERPABLOAdministratorSUPERPABLO . PM UPDATE 10095206 06/09 16:10:02 .Net SqlClient Data Provider 5456 RUNNABLE SUPERPABLOAdministratorSUPERPABLO . PM SELECT INTO 151 2706/09 16:10:33 SQL Query Analyzer 56(17 row(s) affected)spid dbid ObjId IndId Type Resource Mode Status------ ------ ----------- ------ ---- ---------------- -------- ------51 5 0 0 DB S GRANT52 5 0 0 DB S GRANT52 5 1117963059 4 PAG 1:7401 IS GRANT52 5 1117963059 4 KEY (5301214e6d62) S WAIT52 5 1117963059 0 TAB IS GRANT54 5 1117963059 0 TAB IX GRANT54 5 1852025829 0 TAB IX GRANT54 5 1181963287 3 PAG 1:9017 IX GRANT54 5 1117963059 4 KEY (5301934930a4) X GRANT54 5 1117963059 3 KEY (530187fc93f3) X GRANT54 5 1117963059 4 KEY (530154df71eb) X GRANT54 5 0 0 DB [BULK-OP-LOG] NULL GRANT54 5 0 0 FIL 2:0:d U GRANT54 5 1117963059 2 KEY (1d0096c50a7d) X GRANT54 5 1117963059 2 KEY (1b004a9a6158) X GRANT54 5 1117963059 2 KEY (1800a435d44a) X GRANT54 5 1181963287 6 PAG 1:8745 IX GRANT54 5 1181963287 4 PAG 1:8923 IX GRANT54 5 1181963287 2 PAG 1:8937 IX GRANT54 5 1117963059 4 KEY (5301112b0696) X GRANT54 5 0 0 PAG 1:10889 IX GRANT54 5 1181963287 5 PAG 1:8859 IX GRANT54 5 1181963287 6 PAG 1:10888 IX GRANT54 5 0 0 PAG 1:10891 IX GRANT54 5 0 0 PAG 1:10893 IX GRANT54 5 0 0 PAG 1:10892 IX GRANT54 5 0 0 PAG 1:10894 IX GRANT54 5 0 0 PAG 1:10882 IX GRANT54 5 1117963059 3 KEY (530135fbce35) X GRANT54 5 1117963059 0 RID 1:7387:57 X GRANT54 5 1117963059 0 RID 1:7387:59 X GRANT54 5 1117963059 0 RID 1:7387:61 X GRANT54 5 1117963059 3 KEY (5301406ad2bc) X GRANT54 5 1117963059 4 PAG 1:7401 IX GRANT54 5 0 0 PAG 1:7387 IX GRANT54 5 1117963059 2 PAG 1:7389 IX GRANT54 5 1117963059 3 PAG 1:7391 IX GRANT54 5 1117963059 0 RID 1:7387:10 X GRANT54 5 1117963059 0 RID 1:7387:56 X GRANT54 5 1117963059 0 RID 1:7387:58 X GRANT54 5 1117963059 0 RID 1:7387:60 X GRANT54 5 1117963059 3 KEY (530144afbed8) X GRANT54 5 1117963059 4 KEY (530115ee6af2) X GRANT54 5 1117963059 3 KEY (5301c6cd88ea) X GRANT54 5 1149963173 0 TAB IX GRANT54 5 1181963287 0 TAB X GRANT54 5 1117963059 4 KEY (5301d2782bbd) X GRANT54 5 1117963059 3 KEY (5301015bc9a5) X GRANT54 5 0 0 DB S GRANT54 5 0 0 DB [BULK-OP-DB] NULL GRANT54 5 1117963059 4 KEY (5301501a1d8f) X GRANT54 5 1117963059 2 KEY (1c00f3a2b6c5) X GRANT54 5 1117963059 2 KEY (1a002ffddde0) X GRANT54 5 0 0 PAG 1:7411 IX GRANT54 5 1117963059 2 KEY (1900c15268f2) X GRANT54 5 0 0 PAG 1:10840 IX GRANT54 5 1181963287 4 PAG 1:10841 IX GRANT54 5 0 0 PAG 1:10842 IX GRANT54 5 1117963059 3 KEY (5301059ea5c1) X GRANT54 5 0 0 PAG 1:10820 IX GRANT54 5 1181963287 4 PAG 1:10821 IX GRANT54 5 1181963287 5 PAG 1:10874 IX GRANT54 5 1181963287 5 PAG 1:10876 IX GRANT54 5 0 0 PAG 1:10877 IX GRANT54 5 1181963287 5 PAG 1:10878 IX GRANT54 5 0 0 PAG 1:10849 IX GRANT54 5 0 0 PAG 1:10850 IX GRANT54 5 1117963059 2 KEY (1700f225b712) X GRANT54 5 1117963059 4 KEY (5301214e6d62) X GRANT56 5 0 0 DB S GRANT56 1 85575343 0 TAB IS GRANT
View 29 Replies
View Related
Mar 22, 2007
I am having a problem getting error rows to redirect between an OLE DB Source and an OLE DB Destination when using transactions. Each time I turn on the transaction control I get an error stating:
"[OLE DB Destination [48]] Error: The input "OLE DB Destination Input" (61) cannot be set to redirect on error using a connection in a transaction."
I get the above Error when using MSDTC. I have the data flow inside of a Sequence Container with the transaction option set to REQUIRED and the Isolation Level set to Serializable. I have tried all the Isolation levels.
I have the error rows piped off to a seperate OLE DB Destination. I have also tried using native SQL transactions with Execute SQL tasks to BEGIN, COMMIT or ROLLBACK the transaction. This does not work either. It looks like it works properly when the data flow is successful but using profiler I can see SSIS opens up a seperate process for the BEGIN and then another one with the Data Flow task. When I intentionally fail the Data Flow the Rollback always fails. I made sure I had RetainSameConnection turned on for the Connection I was using.
I am speculating that the Data Flow does not know what to Rollback the actual rows that succeeded or the error rows that are getting piped off.
I am fairly stumped on this one so any help is appreciated.
Thanks
View 4 Replies
View Related
Oct 7, 2015
Client is running X- version of application and corresponding database size is huge. Now client's vendor is releasing Y-version of same application with many database schema changes (like new tables added, new columns added, renamed existing columns and etc) To upgrade to the Y-version, vendor is suggesting to my client that down the system and do the upgrade for application/database to Y-version. We are sure that this process will take days together to upgrade to the Y-version. My client is not ready to down the system for that long. So we are trying to find the solution with minimal down time.The approach we are thinking is,Â
1) Create the replicated database to another server (server2) from production server(server1) using golden gate with X-version
2) Create new tables/schema updated tables from Y-version database on same server1. Here for  Updated schema tables we are planning to use the name <table_name_Y_version> as the same table name exists in X-version.
3)With above 2 steps, golden gate replicate the changes from production to server1 and server1 will have the new Y-version table schema (with different concatenate name ' _Y_version'). BTW , there is no affect for the production
4) At this stage we are planning to find best approach, to fill the '<table_name>_Y_version' from X-version tables. two challenges here a) all data needs to be moved to Y-version tables b) they have to sync data in real time.
we thought of going to
a) ssis package to pump the data to Y-version tables, but real time data will not sync.
b) trigger based technique, previous experience said, lot of load
c) thinking about sql replication.
View 5 Replies
View Related
Sep 21, 2006
Hi,I'm new to ASP.NET, and am currently looking into XML.I'm trying to write XML using data from an SQL Server 2000 table. But I seem to be getting the following error regarding the SQL Server connection:Compiler Error Message: CS1502: The best overloaded method match for 'System.Data.SqlClient.SqlCommand.SqlCommand(string, System.Data.SqlClient.SqlConnection)' has some invalid argumentsSource Error:Line 23: {
Line 24: SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter();
Line 25: mySqlDataAdapter.SelectCommand = new SqlCommand(queryString, connString);
Line 26: mySqlDataAdapter.Fill(myDataSet);
Line 27: return myDataSet;Source File: c:InetpubwwwrootmappingcreateGeoRSSFile.aspx.cs Line: 25 This is my code:using System;
using System.Data;
using System.Data.SqlClient ;
using System.Configuration;
using System.Collections;
using System.Text;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
public partial class createGeoRSSFile : System.Web.UI.Page
{
protected void Page_Load(object sender, DataSet myDataSet, EventArgs e)
{
string connString = "server=SQLSERV1;database=Historical_Statistics;UID=dbuser;PWD=Password";
string queryString = "SELECT Town, PostCode, Latitude, Longitude FROM UKPostCodes";
using (SqlConnection mySqlConnection = new SqlConnection(connString))
{
SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter();
mySqlDataAdapter.SelectCommand = new SqlCommand(queryString, connString);
mySqlDataAdapter.Fill(myDataSet);
return myDataSet;
}
// Create a new XmlTextWriter instance
XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Encoding.Unicode);
// Start writing!
writer.WriteStartDocument();
writer.WriteStartElement("item");
// Creating the <town> element
writer.WriteStartElement("town");
writer.WriteElementString("PostCode",myDataSet .Tables[1].Columns("PostCode"));
writer.WriteElementString("geo:lat",myDataSet.Tables[1].Columns("Latitude"));
writer.WriteElementString("geo:lon", myDataSet.Tables[1].Columns("Longitude"));
writer.WriteEndElement();
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Flush();
writer.Close();
}
}What seems to be causing this error?Thanks.
View 4 Replies
View Related
Nov 13, 2005
I'm needing to load data on the client side to load into a DataGrid. I decided to use excel to load the data, but it doesn't need to be. My problem is that it only loads from the server not the client. I browse to find the file and get the path with a control named ctlFindFile. A button labeled ctlLoadData will when pressed display the pathway in label1 and also place the pathway in the function GetDataFromExcel which returns a dataset from the spreadsheet and displays the data in a dataset. Data is returned fine if I’m on the server, but when I'm on a remote machine I receive an error. That is unless I've place a spreadsheet with the same name and pathway on the server as on the client machine, then I’m able to load the file. Now how do I get it to load from on the client machine?
Code below:
Private Sub ctlLoadData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ctlLoadData.Click
Label1.Text = ctlFindFile.Value
DataGrid1.DataSource = GetDataFromExcel(ctlFindFile.Value, "SampleNamedRange").Tables(0)
DataGrid1.DataBind()
End Sub
Public Function GetDataFromExcel(ByVal FileName As String, ByVal RangeName As String) As System.Data.DataSet
'Returns a DataSet containing information from a named range in the passed Excel worksheet
Try
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" &_ Data Source=" & FileName & ";Extended Properties=Excel 8.0;"
Dim objConn As New System.Data.OleDb.OleDbConnection(strConn)
objConn.Open()
' Create objects ready to grab data
Dim objCmd As New System.Data.OleDb.OleDbCommand("SELECT * FROM " &_ RangeName, objConn)
Dim objDA As New System.Data.OleDb.OleDbDataAdapter
objDA.SelectCommand = objCmd
' Fill DataSet
Dim objDS As New System.Data.DataSet
objDA.Fill(objDS)
' Cleanup and return DataSet
objConn.Close()
Return objDS
Catch ex As Exception
' Possible errors include Excel file already open and locked, et al.
Return Nothing
End Try
End Function
Error on Client:Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.Source Error:
Line 31: Private Sub ctlLoadData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ctlLoadData.Click
Line 32: Label1.Text = ctlFindFile.Value
Line 33: DataGrid1.DataSource = GetDataFromExcel(ctlFindFile.Value, "SampleNamedRange").Tables(0)
Line 34: DataGrid1.DataBind()
Line 35: End SubSource File: C:InetpubwwwrootSAI_LoadWebForm1.aspx.vb Line: 33 Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
SAI_Load.WebForm1.ctlLoadData_Click(Object sender, EventArgs e) in C:InetpubwwwrootSAI_LoadWebForm1.aspx.vb:33
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
View 1 Replies
View Related
Jul 15, 2004
We have a large SQL database, and we need to send out updated records to many clients' sites which are not connected.
We currently have a tool which looks at the audit log of changes we made, creates a file based on this, which is then emailed to our clients. They then run a tool we created to remerge the changes.
I suspect SQL server replication might make all this possible. Am I right? Can SQL server produce a file automatically which can be applied to a remote database to update the tables as appropriate? From looking at some replication stuff it looks to me like you have to have the servers on the same network.
View 1 Replies
View Related
Aug 29, 2007
Is it at all possible to use this tool without any connection to SQL Server (mine data in Excel Worksheets only)?? Or is it required to connect to SQL Server??
From reading the documentation, one minute I get the feeling this is possible, then the next section I get a feeling it's not. Can anyone help? Thanks.
View 5 Replies
View Related
Sep 29, 2006
I'm trying to resolve an issue that I've run into in my current system.
I have about 10 clients accessing a SQL Server several times per minute (every 10-20 seconds). To have an individual find the next record, I follow the following process:
1. Select the value of the next record in the database to be checked out.
2. Update the record to show that it is checked out to the user.
3. Select the data in the record to display to the user.
3. Update the record to show any changes and to check the record back in after the user edits it.
My issue is that clients can execute at the same time. Right now, with just SQL statements, two clients can get the same value in step #1. That makes them select the same record for editing. Can I use T-SQL to prevent this from happening? If I use a transaction, will the SQL Server 2005 queue up the transactions, or could I still get the same problem of opening up the same record?
Thanks!
Drew
View 3 Replies
View Related
May 28, 2001
We have 15 clients running our applicaton
14 of then conected to SQL server using TCP/IP and it runs fine
1 of 15 when connected using TCP/IP produce "..Time out error "
but runs fine when swiched from TCP/IP to Named pipes
1.What area should we look to correct problem with Time out using TCP/IP ?
2. Where to get information about using TCP/IP via Named pipes ?
View 1 Replies
View Related
May 10, 2006
Product: Microsoft SQL Server 2005 -- Error 29515. SQL Server Setup could not connect to the database service for server configuration. The error was: [Microsoft][SQL Native Client]Encryption not supported on the client. Refer to server error logs and setup logs for more information. For details on how to view setup logs, see "How to View Setup Log Files" in SQL Server Books Online.
View 78 Replies
View Related
May 2, 2006
On Windows XP systems I get the following issue when trying to browse the MSDB folder in SSIS
Client unable to establish connection
Encryption not supported on SQL Server. (Microsoft SQL Native Client)
I have noticed another post where several others have noticed the same issue. It appears to only occur on Windows XP installations. Is there a workaround or fix for this?
View 2 Replies
View Related
Nov 1, 2006
Hi,
I have SQL2000 installed as the default instance, and now I'm trying to install SQL 2005 standard edition as a named instance.
I receive this error :
SQL Server could not connect to database service for server configuration.. [SQL Native client] Encryption not supported on the client. However I'm able to install client tools
The setup works fine on other box with the same config : SQL 2000/Windows XP, is there any work around for this issue ?
In my SQL 2000 client network utilty "Force proctocol encryption " is desabled and did not find the setting for SQL 2005 !
Thank you
View 1 Replies
View Related