Merging Data

Jan 12, 2007

I have a function that returns a range of numbers and a query that returns a varchar field and an int field. I would like to replace the int field in the query with unique ranged numbers from the function(one per row).

Any ideas?

Thanks,
Mark

-- use ifms

select *
from dbo.fnRange(5101,5152)


select --distinct s.OrgKeyId, 10420 TableNumber, 5100 DetailCodeNumber, s.NewStratalabel CodeDescription, s.NewStratalabel CodeAbbreviation, 1 CodeActiveFlag, Getdate(), 0
distinct s.NewStratalabel, 5100
from _StrataLabel_xref s
Left Outer Join(select * from org_Detail_Code where tablenumber = 10420 and orgkeyid in (Select distinct OrgkeyId from _StrataLabel_xref)) o
on o.OrgKeyId = s.OrgKeyId and o.CodeDescription = s.NewStratalabel
where o.Detailcodenumber is null
order by s.NewStratalabel


5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152

H3Bt5100
H3Cr5100
H4Bt5100
HS1Ar5100
HS1Cr5100
HS2Air5100
HS2Ar5100
HS2Br5100
HS2Cr5100
HS3Ai5100
HS3Bi5100
HS3Bit5100
HS3Cr5100
HS4Am5100
HS4Bi5100
HS4Bm5100
HS4Bt5100
HS4Ct5100
HS4Dr5100
NFrd5100
S2Ap5100
S2Ar5100
S2Ax5100
S2Bp5100
S2Br5100
S2Bw5100
S2Bx5100
S3Ap5100
S3Aw5100
S3Ax5100
S3Bw5100
S3Bx5100
SH1Api5100
SH1Br5100
SH1Cr5100
SH2Air5100
SH2Ap5100
SH2Ar5100
SH2Ax5100
SH2Bir5100
SH2Bix5100
SH2Bp5100
SH2Br5100
SH2Bw5100
SH3Ai5100
SH3Ap5100
SH3Api5100
SH3Bw5100
SH3Cr5100
SH3Di5100
SH4Bm5100
SH4Bwi5100

View 3 Replies


ADVERTISEMENT

Power Pivot :: Merging Static Excel Data With Dynamic Data?

Aug 19, 2015

I have some data in Excel - sheet1 which would be static.

Now I need to import data from SQL Server (using a query) and Union above static data with this SQL data and later I will have to create PowerPivot table in Sheet2.

Which is suitable option for me to import data from SQL to excel as I see "From SQL Server" option under "Data" and "Power Query" tab as well.

How to merge above SQL data with existing static data?

(SQL Server 2012)

View 6 Replies View Related

Merging Data

Jun 3, 2008

I have 2 tables that have the exact same structure and have some common values.
T1 = a,b,c,d,e
T2 = e,f,g,h

I want to create a single distinct table which captures all unique in both tables. I have a common fields ID in both, I can match on. I don't want duplicates which is what's happening now..

CombinedT = a,b,c,d,e,f,g,h

Thanks.

View 3 Replies View Related

SSIS : Merging Two Data Sources Data

Jul 9, 2007

Hi guys,

I manage to get the SSIS working. Now I would need to do these tasks.

I first want to get data from 2 different sql servers. What would be the best method to accomplish this? Both are in Sql Server 2005.

Secondly I want to make sure if any of the servers couldn't be found on the network or in any case the getting data task failed for any one of them the package won't continue and an email should be send to an email address.

Thirdly If everything is ok then I should combine both and generate one sequence no for them and save them on to another location and then generate a file with modified values.


Can anyone help me regarding these tasks?



Thank you



Gemma

View 17 Replies View Related

Merging Data From Two Databases

Sep 14, 2007

i have two databases one has
firstname, lastname
and the othere
firstname, lastname, emailaddress

how do i get to merge the data from emailaddress to the 1st datbase?

Melvin Felicien
IT Manager
DCG Properties Limited

View 6 Replies View Related

Merging Row Data Or Any Suggestions

Feb 5, 2008

Hi
I have been given a table that contains data in this format:

SALESPERSON SALESPERSON_ID CLIENT DATE_FROM DATE_TO AGE
TOM 12345 NULL NULL NULL NULL
NULL NULL MARYSMITH 1/1/2008 12/31/2008 46
NULL NULL JANEDOW 1/1/2008 12/31/2008 24
ED 56789 NULL NULL NULL NULL
NULL NULL TOMJONES 1/1/2008 12/31/2008 65
ANTHONY 243546 NULL NULL NULL NULL
NULL NULL BEVBLACK 1/1/2008 12/31/2008 15
NULL NULL JEANTHOMAS 1/1/2008 12/31/2008 29

Basically this is ONE table that contains header and detail data ordered sequentially. There are not unique identifiers for the rows. The rows are ordered sequentially so that each SALESPERSON is followed by one or more CLIENTs.

If I could merge the rows, the result would look like:

SALESPERSON SALESPERSON_ID CLIENT DATE_FROM DATE_TO AGE
TOM 12345 MARYSMITH 1/1/2008 12/31/2008 46
TOM 12345 JANEDOW 1/1/2008 12/31/2008 24
ED 56789 TOMJONES 1/1/2008 12/31/2008 65
ANTHONY 243546 BEVBLACK 1/1/2008 12/31/2008 15
ANTHONY 243546 JEANTHOMAS 1/1/2008 12/31/2008 29


I am not how to do this with this data.

I also thought maybe it would be better to add unique identifiers to each set of SALESPERSONs/CLIENTs, and work with the data that way, but I am not sure how to do that.

Any help or suggestions would be appreciated. I have no ability to change this data - I have to try to work with it if possible.



JLH

View 4 Replies View Related

Problem In Merging Data

Aug 13, 2006

Hello, i have a database which is subscrribed into two databases. It is subscribed to one database throught a PUSH SUBSCRIPTION and it is subscribed to another with PULL SUBSCRIPTION. The problem is that it is correctly syncronized with PUSH SUBSCRIPTION publication but it does not merge data correctly to PULL PUBLICATION.

When i try to run Merge Agent from subscriber it gives me following error:

Retrieving publication information
Retrieving subscription information
The specified subscription type is invalid.
Category:NULL
Source:  Merge Process
Number:  -2147201020
Message: The specified subscription type is invalid.


 

P.S : When i run Merge Agent from EM, it says, " No Data to be merged "

Regards,

View 1 Replies View Related

Merging Data From Excel To Server

Dec 24, 2014

Working on sql integration with hybris. i was new to this hybris environment previously my job was completly admin part. Now i got a project where i need to fetch data from hybris (Data Hub) and then i need to maintain the same records in sql server with same attributes and sometimes we need to add new attributes and tables even.

How we can import data from the excel sheet to sql server. For this i have gone through 2 approaches whether using merge statement through stored procedure or SSIS package (I don't know whether it works out for the same to merge data in sql server, if it works). Which of the procedure is more efficient. previously my tasks were completely admin tasks and i dnt have much knowledge about developing part.

View 6 Replies View Related

Merging A Data Cube With An Sql Database

Sep 3, 2007



I've seen posts about merging 2 databases but everyone is talking about 2 SQL based databases. I have a data cube based on MDX query giving me all the Sales data. I have a Excel sheet with the Budgets in it, thanks to the connector i can browse through my Excel file using SQL statements.

Now the problem that i have is i want to merge these 2 data's into one report i want to provide Sales figures from the cube with the budgets next to them which are stored in the Excel file.

So basicly is it possible to merge an MDX based database with an SQL database ? Cuz all the solutions i have found to far is by joining databases which is always done on SQL level.

Is this possible or just impossible ?

Thanks in advance
Joa

View 5 Replies View Related

Merging Data Values (HELP NEEDED!!)

May 7, 2007



Hi,



i'm new to this and i am trying to create a statement that would add the values together for Hong Kong and China and then delete the Hong Kong road. (this is a example what i am trying to acheive)

anyone know how to do this.








Name

Area

Population


China

54546554

545845110


Hong Kong

1222

1212


United Kingdom

1215455

1212154


France

2354545

5445445



Many thanks

View 3 Replies View Related

T-SQL (SS2K8) :: Merging Intervals With Identical Data

Jul 10, 2014

I'm having issues building a cte sql statement for merging intervals. I have a table with data as follows:

declare @table table
(
startpoint int,
stoppoint int,
value int
[Code] ....

The resulting query returns the rows in the table, sorted by startpoint:

startpoint stoppoint value
----------- ----------- -----------
0 10 1
10 15 1
15 25 2
25 30 2
30 40 2
40 55 3
55 60 3
60 80 2

I'm looking for a merge cte that returns consecutive intervals with the same value, as follows:

startpoint stoppoint value
----------- ----------- -----------
0 15 1
15 40 2
40 60 3
60 80 2

View 3 Replies View Related

Data Access :: Merging Two Rows In Two Columns

Jul 8, 2015

I have a table data as shown below.

IDFNLN
1x
1y
2a
2b
3g
4t

I want output as shown below.
  
IDFNLN
1xy
2ab
3g
4t

I want the two duplicate rows to be merged into one. How to achieve it.

View 10 Replies View Related

Merging Data From Multiple Databases With Multiple Tables (all With The Same Structure)

Nov 15, 2006

Hi!

I have 7 source databases and one target database, all using the same structure. The structure is made of 10 tables, with foreign key constraints.

I need to merge the source databases into the target (which won't have any data before that process, but will already have the correct schema), and to keep the relationships between the records.

I know how to iterate over the source databases (with SMO foreach), but I'd like to know if someone can advise the best copy method for that context in SSIS ? (I don't want to keep the primary keys, but I need to keep the relationships...)

Any pointer most welcome!

best regards and thanks

Thibaut

View 1 Replies View Related

Merging Data From Table 1 To Table 2??

Jan 11, 2006

I don't know the correct syntax to accomplish this. I've looked in the on-line help but am not coming up with anything.

Basically I have two identically structured tables in two separate databases.

I wanted to select anything from the dbo2.table that isn't in the dbo1.table and insert it into dbo1.table.

I thought I could do something like... quote:

Select INTO dbo1.table

and then add my select statement. But that throws an error:
quote:Server: Msg 2714, Level 16, State 6, Line 1
There is already an object named 'bkupproceduresfeeschedule' in the database.

And the on-line documentation says an INTO is only for a new table.

How can I merge records from one table into another table?

View 9 Replies View Related

Merging Db

Apr 19, 2007

hello
im working on a project with a friend and store source files in a subversion server. since we are both working on the same DB everytime one of us makes a change we discover a problem in merging our changes.

is there any tool that can help in merging and making diff??
is there any alternativa?

View 1 Replies View Related

Merging Two SQL Tables

Sep 14, 2006

I have two SQL tables with the following structureInstructor tableINIDINNameINEmailInstructor PhotoIPIDINIDIPPhotoNow my new Instructor table got a new fieldINIDINNameINEmailINPhotoQuestion, how can I merge the Instructor Photo table IPPHoto field into Instructor table INPhoto field? Thank you. 

View 3 Replies View Related

Merging Database Log

Feb 3, 2008

 I wonder about the possibility of merging two identical databases on two different servers upon recovering from connection failure between them, using triggers. In order to create a simple synchronization

View 1 Replies View Related

Please Help In Merging Database.

Apr 8, 2008

I have a website wih about 50000 pageviews permonth. I am using multiple access database for each section. for example for photogallery there is a separate database, for jokes there is another one. Now I am thinking to convert my all access databases into MSSQL Server2005 databases.There are about 5 access databases  I want to merge them and convert them into 1 MDF file.How to do this?I am very new to SQL Server. Please Help I update access databases in MS ACCESS and upload them in server.When I will use SQL Server Databases How will I update them? From VS2008? Any other method? Or Should I think about creating WebBased control panel for my website like CP present in every CMS(joomla, dotnetnuke etc)? ....................................................................................................................... I have VS2008 and SQL Server 2005 Express. 

View 6 Replies View Related

Table Merging

Oct 18, 2004

I have two tables each with a date field. I have to combine these two tables and sort on the date. I want the date from each table to be on the same column though, not in seperate columns.


Ex:
Table A

ID
Log_Time
ETI

Table B
ID
Log_Time
Action
Description


Thanks for the help

Rock *

View 3 Replies View Related

Merging 2 Different SQL Server DB Into One

May 15, 2006

I have two sql server databases...one holds nothing but personalisation information. The other holds various other types of data. I would like to merge these two DBs into one (including all stored procedures,etc.), but being a relative noob to SQL Server, I can't seem to figure out exactly how to accomplish this. Neither database holds anything that the other holds; data-wise, stored procedure-wise or any other wise. ;-)
Can anyone point me in the right direction?

View 1 Replies View Related

REPLICATION MERGING

Aug 20, 2002

Hi, I want to make fusion replication.

We've got an incident database on our server and we want our
consultants could add, modify, delete incidents on our customers sites
with their laptop.
When they come back we can also synchronise our incidents database
with their modifications.

I defined the database on our server ( sql7 sp3) as distibutor and
publisher, the other computers coulb be only suscribers.

It would be very easy except for a case :

when a line is modified on our server database and the same line in
the same table is modified on the suscriber computer, the changes on
publisher (distiributor) seems to have priority on the suscribers.
But we would like to control this : we want the suscribers, when they
come back, if this case appears, could choose good merging or not if
it's possible, and if it is not, we would like at less they could have
a message saying they will lost that they change (incident by incident
if it's possible)

So what is possible to resolve it by the best way ?

Thanks to your answers

Best regards

Axel

View 1 Replies View Related

Merging Fields

Sep 4, 2001

Help!!, Does anyone know of a way that I can merge three seperate fields into one field in my sql statement.
EG.
SELECT catnumber, catnumber2,catnumber3
FROM Categories
WHERE Customer = 'xxxx' and itemnumber = 1 or 2 or 4

I want the catnumber, catnumber2, catnumber3 all in one field so I can sort by it.
If anybody could help me it would be greatly appreciated.
Thanks
Mike

View 1 Replies View Related

Merging On Export

Apr 2, 2008

Hi,

I need to figure out what is the easiest way to do this is. I have two tables that have the following columns:


Code:

TABLE 1
AcctNbr, GiftRef, Gdate, PayCode, Amt

Table 2
GiftRef, Amt, MotvCode, FundId


I need to merge the two tables with GiftRef being the common table between them. I have exported the tables from MSSQL to Access and am wondering what the easiest way to do this is. Is there an SQL Query that can merge the two tables on export by GiftRef? Is it easier to do this in Access now that I've exported the two Tables? Any help on this would be awesome. Thanks.

View 5 Replies View Related

Importing And Merging Csv Using Sql

Sep 20, 2004

Hi Gurus.

My client drops for me many files like this on a shared drive M: daily
1_Test.csv
2_Test.csv
3_Test.csv

I would like you to advice on how to write a SQL code (that can include DTS if possible) that will take this files, merge them into one (since they have same columns) and send them to another client as one file. But it must only take the files of the same date and must not resend files i have send already. I need this to be an automated process since the files are dumped into M:drive midnite and I need this code so that I can schedule it as a job and run around 4h00am.

View 3 Replies View Related

Merging Databases

Aug 17, 2006

I'm pretty new to SQL altogether. I kinda gave myself a crash-course when the software I was using, Papertrack, was having problems. It all started when I tried to move the database. Now there are two separate databases that I can see on SQL Enterprise manager. I picked up the book and figured some things out, but still don't know how to merge the databases. I called the support for the software and got to know them on a middle-name basis. Is there a way I can merge the two databases so that the software can pull queries from both and access the files?
To anyone that likes a challenge,

Thanks

View 6 Replies View Related

Merging Two Mssql Db

Feb 5, 2004

I have a problem that I need help on.

Right now, I have two MSSQL server and I am trying to merge them into one.

The problem is, I do not know the login Id and password for some of the users.

I know the login information are stored under syslogins at the master db.

How do I get the information out and append to the syslogins table of the second mssql db?

Any help would be appreciated.

---alucarrd

View 3 Replies View Related

Help Merging Records?

Oct 15, 2005

Hello there. I am Completely new to SQL and this forum, and this problem that I have may appear to be very basic to you guys but still... I was wondering if I could get some help with a database I am trying to make in MS Access.

I have used the Access TransferText function to import data from a text file into a table with an ID attached to each line, eg.

ID Text
1 Hello world
2 This is an example
3 Of my database

I want to merge the data, or copy it into a field in a new table to get:

ID Text
1 Hello World
This is an example
Of my database
2 [more imported text from a different table]

and i have been advised that SQL is the best way to do this. Is it possible to have line breaks in a field within microsoft access, or would it have to be structured as

ID Text
1 Hello World This is an Example Of My Database
2 ...

And how would i make the SQL to do this?

Thanks,

Thom

View 2 Replies View Related

Merging Rows

Jun 28, 2006

Say I have a table with the columns (and example data):

CustomerNo, ContactNo, ActivityNo
null, null, 1
100, null, 1
null, 666, 1
null, null, 2
200, null, 2
null, 777, 2

From this I would like to get the result:

CustomerNo, ContactNo, ActivityNo
100, 666, 1
200, 777, 2

How do I solve this. Im getting grey hair here...

View 5 Replies View Related

Merging Two Database

Sep 10, 2007

Hi,
We have we had a database in 2006 with around 90 tables and later we created a new database in 2007 with more tables for same application. Now we want to have a database which will contain all records from the two above database. how should we go about this??

Bharath JrDBA

View 4 Replies View Related

Merging Like Rows

Jan 20, 2008

Hi All,

I have a query that I'm working on, but instead of giving the query, I wanted to ask a basic syntax question. If more info is needed, let me know. If you have 2 rows that have a common relationship, but differing information in some fields, can you merge them all onto one row? I've done this with Sum(case) expressions, but I don't want to 'add' anything. In the following example, the ActivityID refers to a break. ActivityID can be:

0=Pick up
1=Drop Off
2=Lunch
3=Break

So if I wanted to see 2 breaks on 1 row in the following example, would this be possible:



Veh ActID ArrTime DepTime
1 3 7:00 8:00
1 3 10:00 11:00



Veh ActID ArrTime DepTime ArrTime DepTime
1 3 7:00 8:00 10:00 11:00


Thanks in advance for your help!

Craig

View 4 Replies View Related

SQL Merging Rows

Oct 20, 2006

Hello everyone!

Maybe you can help me out:

I have 2 tables (A and B), Table A has 2 fields t1 and t2...each of them has a number that is related to the primary key of Table B.

What i want is to make a query that presents:

t1,t2, B.descriptionof_t1, B.description_t2

Anyone that can help me?



Thanks in advance...

View 5 Replies View Related

Merging 3 Statements To 1

Apr 18, 2007

Hello,

I have a question. I want to perform the following task:

1) UPDATE wdoctyp SET ldoclock=0 WHERE docType='LEAVE'
2) SELECT idoclastsn FROM wdoctyp WHERE docType='LEAVE'
3) UPDATE wdoctyp SET ldoclock=1, idoclastsn=idoclastsn+1 WHERE
docType='LEAVE'

can I perform it in one SQL statement? Actually the reason I want to do this is because I want to prevent ldoclock from locking forever due to computer failure.

Can somebody give me a hand?

Best regards,
Tee Song Yann

View 3 Replies View Related

Merging Xml File

Apr 1, 2008

i have the following xml file :

<transport>
<train> 10
</train>
<plane>10
</plane>
<metro>10</metro>
<bm>10</bm>
<voiture><avion> 10 </avion></voiture> <voiture><train>10</train></voiture> <voiture><mercedesC230> 10 </mercedesC230></voiture>
<nissan>
<Z>10 </Z>
</nissan>
</transport>

**what i wanna do is to get the following result :

<transport>
<train> 10
</train>
<plane>10
</plane>
<metro>10</metro>
<bm>10</bm>
<voiture><avion> 10 </avion><train>10</train><mercedesC230> 10 </mercedesC230></voiture>
<nissan>
<Z>10 </Z>
</nissan>
</transport>
---------------------------------------------------------------------------------------------------------------------------------------------------------------
this means that i want to merge all the child nodes that belong to the same parent node.
thanks for any help

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved