Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
slashman26
Starting Member
2 Posts |
Posted - 2008-07-09 : 10:10:38
|
Hello,sorry if the subject is mis-leading. Here is what I would like to be able to do and not sure how to do it.I want to take 2 diferent values and merge them together and store them in a seperate table later to qurery against those results. Reason for this is because the qurery of the results is happening on a different server and database then the 2 fields are.Here is the situation in more detail...We have a core business system with Orders and invoices in them. An order number and invoice number can be the same number but NOT be related to each other (i.e the same number could be an order number for customer 1 and invoice for customer 2. Don't ask why that is because I don't know why it is)... anyway I need to merge those numbers with a seperate flag field that tells it what document it is (I=invoce, O= order etc). The reason for this merge is because I have a separte system that is going to be looking for that "Merged" value from a barcode on a scanned document from a different database.So the here is what I am looking for:F document_Number I 00003O 00003I 00004O 00004 ...So the above result would be:Merged_field_in_different_database I00003O00003I00004O00004...Any ideas on how to make this work? This type of stuff i'm not sure is possible in SQL 2000 so that is why I am asking. Thanks in advance!Jay |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-07-09 : 10:26:13
|
select F + document_Number from table.But why merge them into a seperate table? If you have these in a different database on the same server, just use select F + document_Number from database.owner.table, if they are on seperate servers and you have a linked server (which i'm guessing you must do), use select F + document_Number from linkedserver.database.owner.tableIf the datatypes are different, then use convert() |
 |
|
slashman26
Starting Member
2 Posts |
Posted - 2008-07-09 : 10:41:51
|
The database server are seperate servers. The one that will be doing the query will be pulling information from the other system (automated) in the early morning hours. The query of the scanned number happens anytime durning normal hours. So the result has to be stored. The server we are pulling information from is across a long VPN so the servers are not even in the same location, hence why I would like to store the information. |
 |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-07-09 : 10:46:39
|
well, just use the query I gave you.select F + document_Number as newfield from table |
 |
|
|
|
|