I am tring to recreate my oracle database -> sql server 2008. I never used sql server before, so I am using sql server management studio. I could create tables and views. The views I created using sql server management studio GUI has data in it.
Now, I tried to use a script to create a view. The view was created but no data in it... I am sure that I'm missing some basic things.
Anybody please tell me what am I missing?

USE[DB101] 
GO
CREATE VIEW TEST 
AS
SELECT     dbo.EMPLOYEE.EMPID, dbo.EMPLOYEE.LASTNAME, dbo.EMPLOYEE.MIDDLE, dbo.EMPLOYEE.FIRSTNAME, dbo.EMPLOYEE.STREET, 
                      dbo.EMPLOYEE.CITY, dbo.EMPLOYEE.STATE, dbo.EMPLOYEE.ZIP, dbo.EMPLOYEE.TERMS, dbo.EMPLOYEE.RATE, dbo.EMPLOYEE.QTY, 
                      dbo.EMPLOYEE.VAC_RATE, dbo.EMPLOYEE.QTY_PAID_VAC, dbo.EMPLOYEE.QTY_OVER_TIME, dbo.EMPLOYEE.[GROSS-PAY], 
                      dbo.EMPLOYEE.IDTAX, dbo.TAX.TAX_TOTAL, dbo.EMPLOYEE.OT_RATE, dbo.EMPLOYEE.NET_PAY
FROM         dbo.EMPLOYEE INNER JOIN
                      dbo.TAX ON dbo.EMPLOYEE.IDTAX = dbo.TAX.IDTAX
GO

Regards,

Re: recreate my oracle database to sql server 80 80
Member Avatar

Anybody please tell me what am I missing?

I don't see anything wrong with your query.

Read this (the link has diagrams and query for you to see and hopefully you can used it to test out your own code):

http://www.oracle.com/technetwork/articles/datawarehouse/oracle-sqlserver-goldengate-460262.html

Re: recreate my oracle database to sql server 80 80

Thank you for your reply.
I will try.

Re: recreate my oracle database to sql server 80 80

I hate to say this but it was my mistake using inner join. I had to use left outer join in order to create this view....I'm sorry.

Re: recreate my oracle database to sql server 80 80
Member Avatar

I hate to say this but it was my mistake using inner join. I had to use left outer join in order to create this view....I'm sorry.

I don't have a database at home to test the query you have. The query you created looks right. It's all about using which word (INNER JOIN or OUTER JOIN) to make the query work. I'm glad you solve the issue and figuring out what word (INNER JOIN or OUTER JOIN) to used for the query to work the way you wanted.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.