Converting Oracle SQL To MS-SQLServer SQL

Jul 20, 2005

Hello,

Has anyone a small tool or somekind of document which could help me
to convert Oracle SQL scripts to SQL Server?

Scripts are not very Oracle specified.

Thanks,

Below is a Script that I would e.g convert to MS SQLServer:



SET SCAN ON

PROMPT Enter the password and TNS name.
PROMPT Enter the oracle SID for TNS name if you are running a local database.

CONNECT system/&systempassword@&&tnsname

-- Drop the user and all other related objects.
DROP USER webstore CASCADE;

-- Creating the schema
CREATE USER webstore IDENTIFIED BY welcome;

-- Grant the permissions to the user.
GRANT RESOURCE, CONNECT TO webstore;


ALTER USER webstore DEFAULT TABLESPACE users
QUOTA UNLIMITED ON users;

ALTER USER webstore TEMPORARY TABLESPACE temp;

CONNECT webstore/welcome@&&tnsname

PROMPT Creating Tables

-- Create the category table which contains the data for the categories.
CREATE TABLE category (
id NUMBER(10) CONSTRAINT pk_vsm_country PRIMARY KEY,
name VARCHAR2(20) NOT NULL
);

-- Create category attributes table which has attributes for the categories in
-- the category table.
CREATE TABLE category_attributes (
category_id NUMBER(10) NOT NULL,
label VARCHAR2(20) NOT NULL,
CONSTRAINT pk_vsm_cat_attr PRIMARY KEY(category_id,label),
CONSTRAINT rk_vsm_catattr_cat FOREIGN KEY(category_id) REFERENCES
category(id) ON DELETE CASCADE
);

-- Create country table to hold the country names.
CREATE TABLE country (
id NUMBER(4) CONSTRAINT pk_country PRIMARY KEY,
country_name VARCHAR2(50) CONSTRAINT uniq_country UNIQUE
);

-- Create users table to hold user details.
CREATE TABLE users (
user_name VARCHAR2(20) CONSTRAINT pk_users PRIMARY KEY,
first_name VARCHAR2(20) NOT NULL,
last_name VARCHAR2(20),
e_mail VARCHAR2(50) NOT NULL,
address VARCHAR2(200) NOT NULL,
city VARCHAR2(20) NOT NULL,
state VARCHAR2(20) NOT NULL,
country NUMBER(4) NOT NULL ,
zip NUMBER(8) NOT NULL,
phone VARCHAR2(20) NOT NULL,
role VARCHAR2(10) NOT NULL,
password VARCHAR2(200) NOT NULL,
card_provider VARCHAR2(30),
card_number VARCHAR2(200),
card_expiry_date DATE ,
CONSTRAINT rk_usr_cntry FOREIGN KEY(country) REFERENCES
country(id) ON DELETE CASCADE
);

-- Create shops master table.
CREATE TABLE shops (
id NUMBER(10) CONSTRAINT pk_shops PRIMARY KEY,
shop_name VARCHAR2(50) NOT NULL,
user_name VARCHAR2(20) NOT NULL,
description VARCHAR2(4000),
category_id NUMBER(10) NOT NULL,
reg_date DATE NOT NULL,
status VARCHAR2(20) NOT NULL,
CONSTRAINT chk_shops CHECK( status IN ('Approved', 'ApprovalPending',
'Rejected','Discontinued') ),
CONSTRAINT rk_shop_cat FOREIGN KEY (category_id) REFERENCES category(id)
ON DELETE CASCADE,
CONSTRAINT rk_shop_user FOREIGN KEY(user_name) REFERENCES users(user_name)
ON DELETE CASCADE
);

-- Create sub_category table which has the sub categories listed for each shop.
CREATE TABLE sub_category (
id NUMBER(10) CONSTRAINT pk_subcat PRIMARY KEY,
category_id NUMBER(10) NOT NULL,
shop_id NUMBER(10) NOT NULL,
name VARCHAR2(20) NOT NULL,
CONSTRAINT rk_subcat_cat FOREIGN KEY(category_id) REFERENCES category(id)
ON DELETE CASCADE,
CONSTRAINT rk_subcat_shop FOREIGN KEY(shop_id) REFERENCES shops(id)
ON DELETE CASCADE
);

-- Create item master table.
CREATE TABLE item (
id NUMBER(10) CONSTRAINT PK_VSM_ITEM PRIMARY KEY,
name VARCHAR2(50) NOT NULL,
category_id NUMBER(10) NOT NULL,
shop_id NUMBER(10) NOT NULL,
description VARCHAR2(4000),
unit_price NUMBER(15,2) NOT NULL,
image VARCHAR2(50),
CONSTRAINT rk_item_subcat FOREIGN KEY (category_id ) REFERENCES
sub_category(ID) ON DELETE CASCADE ,
CONSTRAINT rk_item_shop FOREIGN KEY(shop_id) REFERENCES shops(id)
ON DELETE CASCADE
);

-- Create item_attributes table which has the item attributes for the items
CREATE TABLE item_attributes (
item_id NUMBER(10) NOT NULL,
label VARCHAR2(20) NOT NULL,
description VARCHAR2(4000),
CONSTRAINT pk_item_attr PRIMARY KEY(item_id , label),
CONSTRAINT rk_itemattr_item FOREIGN KEY(item_id) REFERENCES item(id)
ON DELETE CASCADE
);

-- Creat inventory table which maps the quantitly against the item.
CREATE TABLE inventory (
item_id NUMBER(10) CONSTRAINT pk_inventory PRIMARY KEY,
quantity NUMBER(4) NOT NULL,
CONSTRAINT RK_INVNTRY_ITEM FOREIGN KEY(item_id) REFERENCES item(id)
ON DELETE CASCADE
);

-- Create orders master table which stores all the completed orders.
CREATE TABLE orders (
id NUMBER(10) CONSTRAINT pk_orders PRIMARY KEY,
order_date DATE NOT NULL,
user_name VARCHAR2(20) NOT NULL,
shop_id NUMBER(10) NOT NULL,
ship_to_address VARCHAR2(100),
city VARCHAR2(20),
state VARCHAR2(20),
country NUMBER(4),
zip NUMBER(8),
phone VARCHAR2(20),
CONSTRAINT rk_ordr_usr FOREIGN KEY(user_name) REFERENCES users (user_name)
ON DELETE CASCADE,
CONSTRAINT rk_ordr_shop FOREIGN KEY(shop_id) REFERENCES shops(id)
ON DELETE CASCADE
);


-- Create order_items table to store the detailed orders
CREATE TABLE order_items (
order_id NUMBER(10) NOT NULL,
item_id NUMBER(10) NOT NULL,
quantity NUMBER(4) NOT NULL,
unit_price NUMBER(15,2) NOT NULL,
status VARCHAR2(20) NOT NULL,
CONSTRAINT chk_oi check ( Status in ('Pending','Shipped')),
CONSTRAINT rk_oi_ordr FOREIGN KEY(order_id) REFERENCES orders(id)
ON DELETE CASCADE ,
CONSTRAINT rk_oi_item FOREIGN KEY(item_id) REFERENCES item(id)
ON DELETE CASCADE
);

-- Create guest_book table to store all the guest_book entries
CREATE TABLE guest_book (
id NUMBER(10) CONSTRAINT pk_guest_book PRIMARY KEY,
user_name VARCHAR2(50) NOT NULL,
email_id VARCHAR2(50),
rating NUMBER(1),
comment_date DATE NOT NULL,
comments VARCHAR2(4000)
);

-- create sequences.
CREATE SEQUENCE category_seq MAXVALUE 9999999999;
CREATE SEQUENCE shops_seq MAXVALUE 9999999999;
CREATE SEQUENCE sub_category_seq MAXVALUE 9999999999;
CREATE SEQUENCE item_seq MAXVALUE 9999999999;
CREATE SEQUENCE inventory_seq MAXVALUE 9999999999;
CREATE SEQUENCE orders_seq MAXVALUE 9999999999;
CREATE SEQUENCE guest_book_seq MAXVALUE 9999999999;

View 1 Replies


ADVERTISEMENT

Converting Oracle Slq Quer To Sqlserver Query

Jan 14, 2001

Hi ,

I have a question for all , please help me out.

the question is : i have a query in Oracle like this
select count(*), to_char(ISL_FIRST_VISIT, 'Day, mm/dd/yyyy') from ISL_USERS
group by to_char(ISL_FIRST_VISIT, 'Day, mm/dd/yyyy')
order by to_char(ISL_FIRST_VISIT, 'Day, mm/dd/yyyy');

i want to convert this into SQLserver but in SQL server equlent function for TO_CHAR is Datename ..when i have given this i am getting error . please give me the tip on this issue .

thanks
shekhar

--------------------------------------------------------------------------------


|

View 1 Replies View Related

How To Migrate Oracle Applications 11.03/Oracle 8.05 To Navision 4.0/ms Sqlserver

Oct 29, 2005

need a clue about how to migrate the data from an Oracle applications 11.03 and underlying Oracle 8.05 database to navision 4.0 running sql server 2000

tia

View 1 Replies View Related

Converting From Oracle.

Oct 13, 2005

I recently got a new job at a new company.  My previous experience
had all been with Oracle DB's but the new place uses Sql Server
2k.  I have a few general questions about how to do stuff in
SqlServer...

1) how do I create a sequence and a trigger?
2) I know SqlServer probably doesnt have anything like Packages, so are
procedures local to schemas? and if so, are schema's nestable in any
way?
3) Can anyone reccomend a good book on T-SQL?

View 5 Replies View Related

Converting From Oracle

Jan 23, 2008

I am porting some application from AIX/C/Oracle to Windows/C#2005/MS SQL 2000. I have one query which has been giving me problems in translation from Oracle to MS SQL. This query had some decode statements which I changed to CASE statements. It also has Oracle (+) join operator, from what I have found this translates into an *= or =* depending which side the (+) is on.

Here is the query before replacing (+)

SELECT CSUM_TERR_CODE,
INVM_COST_FLAG,
SUM((CASE CITM_PROPRD WHEN '200708' THEN 1 ELSE 0 END) * (CITM_QTY * CITM_PRICE)),
SUM(CITM_QTY * CITM_PRICE)
FROM ACC_CUST_SUM, ACC_CUST_ITEMS, ACC_INV_MSTR
WHERE CSUM_PROPRD BETWEEN '200701' AND '200708' AND
CSUM_COMP_CODE = 'A' AND
CSUM_EMPL_CODE = '85' AND
CSUM_PROPRD = CITM_PROPRD AND
CSUM_INV_SEQ = CITM_INV_SEQ AND
CITM_DEPT_CODE NOT IN ('TR', 'DTR') AND
CITM_COMP_CODE = INVM_COMP_CODE(+) AND
CITM_ITEM_CODE = INVM_ITEM_CODE(+) AND
INVM_COST_FLAG = 'C'
GROUP BY CSUM_TERR_CODE, INVM_COST_FLAG
UNION
SELECT CSUM_TERR_CODE,
(CASE INVM_COST_FLAG WHEN NULL THEN 'A'ELSE INVM_COST_FLAG END),
SUM((CASE CITM_PROPRD WHEN '200708' THEN 1 ELSE 0 END) * (CITM_QTY * CITM_PRICE)),
SUM(CITM_QTY * CITM_PRICE)
FROM ACC_CUST_SUM, ACC_CUST_ITEMS, ACC_INV_MSTR
WHERE CSUM_PROPRD BETWEEN '200701' AND '200708' AND
CSUM_COMP_CODE = 'A' AND
CSUM_EMPL_CODE = '85' AND
CSUM_PROPRD = CITM_PROPRD AND
CSUM_INV_SEQ = CITM_INV_SEQ AND
CITM_DEPT_CODE NOT IN ('TR', 'DTR') AND
CITM_COMP_CODE = INVM_COMP_CODE(+) AND
CITM_ITEM_CODE = INVM_ITEM_CODE(+) AND
(INVM_COST_FLAG = 'A' OR INVM_COST_FLAG IS NULL)
GROUP BY CSUM_TERR_CODE, INVM_COST_FLAG


and after replacing with *, I think I have them in the right place

SELECT CSUM_TERR_CODE,
INVM_COST_FLAG,
SUM((CASE CITM_PROPRD WHEN '200708' THEN 1 ELSE 0 END) * (CITM_QTY * CITM_PRICE)),
SUM(CITM_QTY * CITM_PRICE)
FROM ACC_CUST_SUM, ACC_CUST_ITEMS, ACC_INV_MSTR
WHERE CSUM_PROPRD BETWEEN '200701' AND '200708' AND
CSUM_COMP_CODE = 'A' AND
CSUM_EMPL_CODE = '85' AND
CSUM_PROPRD = CITM_PROPRD AND
CSUM_INV_SEQ = CITM_INV_SEQ AND
CITM_DEPT_CODE NOT IN ('TR', 'DTR') AND
CITM_COMP_CODE =* INVM_COMP_CODE AND
CITM_ITEM_CODE =* INVM_ITEM_CODE AND
INVM_COST_FLAG = 'C'
GROUP BY CSUM_TERR_CODE, INVM_COST_FLAG
UNION
SELECT CSUM_TERR_CODE,
(CASE INVM_COST_FLAG WHEN NULL THEN 'A'ELSE INVM_COST_FLAG END),
SUM((CASE CITM_PROPRD WHEN '200708' THEN 1 ELSE 0 END) * (CITM_QTY * CITM_PRICE)),
SUM(CITM_QTY * CITM_PRICE)
FROM ACC_CUST_SUM, ACC_CUST_ITEMS, ACC_INV_MSTR
WHERE CSUM_PROPRD BETWEEN '200701' AND '200708' AND
CSUM_COMP_CODE = 'A' AND
CSUM_EMPL_CODE = '85' AND
CSUM_PROPRD = CITM_PROPRD AND
CSUM_INV_SEQ = CITM_INV_SEQ AND
CITM_DEPT_CODE NOT IN ('TR', 'DTR') AND
CITM_COMP_CODE =* INVM_COMP_CODE AND
CITM_ITEM_CODE =* INVM_ITEM_CODE AND
(INVM_COST_FLAG = 'A' OR INVM_COST_FLAG IS NULL)
GROUP BY CSUM_TERR_CODE, INVM_COST_FLAG

The Oracle run fine, but when run on MS SQL I get the following error.
The table 'ACC_CUST_ITEMS' is an inner member of an outer-join clause. This is not allowed if the table also participates in a regular join clause.

Any ideas on how I can get this one working?

Thanks

View 2 Replies View Related

Converting From Oracle

Mar 6, 2008

Converting Oracle Queries to run on MS SQL 2000. This is query with a sub-query. If I run each query separatly I get results and if I use NOT IN sub-query I get no results. On oracle I get the correct result, but when moved to MS SQL I get nothing. Here is the original Oracle query and my converted query. Am I missing something?

Oracle
SELECT
INVM_COMP_CODE,
INVM_DEPT_CODE,
INVM_ITEM_CODE,
INVM_DESC,
INVM_UNIT_TYPE,
INVM_LOC,
nvl(INVM_REORDER_POINT,0),
nvl(INVM_REORDER_QTY,0),
nvl(INVM_COST,0),
nvl(INVM_SUG_PRICE,0),
INVM_DEV_CLS
FROM ACC_INV_MSTR
WHERE INVM_COMP_CODE||INVM_ITEM_CODE NOT IN
(SELECT CITM_COMP_CODE||CITM_ITEM_CODE
FROM ACC_CUST_ITEMS
WHERE CITM_PROPRD BETWEEN '200706' AND '200710') AND
(INVM_DEPT_CODE IN (SELECT DEPT_CODE FROM ACCSR03_DEPT) OR
:ws_dept_flag = 1)
ORDER BY INVM_COMP_CODE, INVM_DEPT_CODE, INVM_ITEM_CODE


MS SQL

SELECT INVM_COMP_CODE,
INVM_DEPT_CODE,
INVM_ITEM_CODE,
INVM_DESC,
INVM_UNIT_TYPE,
INVM_LOC,
ISNULL(INVM_REORDER_POINT,0),
ISNULL(INVM_REORDER_QTY,0),
ISNULL(INVM_COST,0),
ISNULL(INVM_SUG_PRICE,0),
INVM_DEV_CLS
FROM ACC_INV_MSTR
WHERE INVM_COMP_CODE + INVM_ITEM_CODE NOT IN
(SELECT CITM_COMP_CODE + CITM_ITEM_CODE
FROM ACC_CUST_ITEMS
WHERE CITM_PROPRD BETWEEN '200706' AND '200710') AND
(INVM_DEPT_CODE IN (SELECT DEPT_CODE FROM ACCSR03_DEPT) OR @ws_dept_flag = 1)
ORDER BY INVM_COMP_CODE, INVM_DEPT_CODE, INVM_ITEM_CODE

View 2 Replies View Related

Converting A Oracle PL/SQL Command Into MS SQL

Jan 31, 2007

hi

I was wondering if anyone would be able to advise on converting oracle PL/SQL features into MSSQL.

For example i have the following sequence + trigger below but cant find any information on creating a sequence in MSSQL, is it possible?

create sequence a_SEQ
start with 001
increment by 1

create or replace trigger a_TG
before insert a
for each row
begin
select (concat('D',(cast(a_SEQ.nextval as varchar(4))))) into :new.a_id from dual;
end;

any links or tutorials would be great, i've got a couple of MSSQL 2005 books which do explain triggers but examples are really needed to understand the full functionality.

cheers

View 5 Replies View Related

Converting Oracle SQL To TSQL

Jul 20, 2005

Hello,I am new to sql*server, but have used Oracle for years. Can anyonerecommend a good online guide for converting all the Oracle SQL I knowto TSQL?tia,Mike

View 1 Replies View Related

Help Converting An Oracle Query To MS SQL

Oct 15, 2007

SELECT distinct whse_zone_id, bay_id
From prod_geneology WHERE whse_zone_id in ('SH','CU','SG')
START WITH unit_id = 'BL7B230811'
CONNECT BY PRIOR parent_id = unit_id


And in this case, 'BL7B230811' could be any 10 character string

Any help would be grateful.

Thanks

View 1 Replies View Related

Converting Database To MS-SQLServer From PostGRESQL

Nov 23, 2006

Forgive me if this question is a bit too generic, if it is, feel free tojust not respond.I have a database which has been running in PostgreSQL for a number ofyears at this stage which I want to port into MS SQL server.It seems that the SQL that Postgre outputs when I do a backup is notsyntactically correct within MS-SQL server.My question is, does anyone have any documentation on how to convert adatabase from the Postgre platform to SQL server? Is it possible usingan ODBC connection to import a database structure including tabledefinitions, views etc into SQL Server?Failing this, does anyone have any suggestions on where I might start -I did attempt to go through the SQL code and modify it to suit SQLserver, but it's about 3,500 lines of code excluding the insertstatements (which themselves are also wrong) and almost every line needssomething changed when comparing SQL syntax from Postgre to MSSQL serverThanks in advance for any comments/suggestions.Engada.--Posted via a free Usenet account from http://www.teranews.com

View 1 Replies View Related

Oracle And SQLServer On The Same Box?

Apr 2, 2004

Develop on both Oracle 9i and SQLServer 2000 back ends and would like to set up a new test/development server. Are there any issues with running both systems on one box?

View 3 Replies View Related

In SQLServer SI In ORACLE NO

Jul 20, 2005

Questo Statement in SQL Server funziona.In Oracle PL/SQL se lo lancio funzionaQuando lo devo far funzionare da Vb.net mi si pianta e non va avanti . Stalì a pensare.Come mai ?UPDATE proc_aziendaSET cod_fase_sign = (SELECT MAX(pfa.COD_FASE)FROM PROC_FASE_RIGA pfaWHERE (COD_GRUPPO = 'x09') AND((TIP_DATI = 'I') OR (TIP_DATI = 'S')) ANDpfa.cod_processo = '02')WHERE cod_gruppo = 'x09' ANDcod_processo = '02'C'è un'altro Statement:UPDATE proc_aziendaSET cod_fase_sign = FaseFROM (SELECT ep.cod_processo,app.cod_azienda,MAX(cast(ep.cod_fase as int)) as FaseFROM esp_proc_prospetti ep,APP_PROSP_AZ_8377 app,(SELECT pa.cod_processo,pa.cod_azienda,pa.cod_fase_signFROM proc_azienda paWHERE pa.cod_gruppo = 'x09' andpa.cod_processo = '05' andpa.cod_fase_sign is nullGROUP BY pa.cod_processo,pa.cod_azienda,pa.cod_fase_sign) pnullWHERE ep.cod_gruppo = 'x09' andep.cod_processo = app.cod_processo andep.cod_processo = pnull.cod_processo andep.cod_prospetto = app.cod_prospettoGROUP BY ep.COD_PROCESSO,app.COD_AZIENDA) FaseAzienda ,proc_azienda paWHERE pa.cod_gruppo = 'x09' andpa.cod_processo = FaseAzienda.cod_processo andpa.cod_azienda = FaseAzienda.cod_aziendaQuesta sintassi sembra regolare per SQL Server ma non per ORACLE.Come deve essere ... ?Grazie milleS.

View 1 Replies View Related

Converting From Oracle - Another Problem Query

Jan 28, 2008

I am getting a slightly different result set after converting my Oracle query to MS SQL. I am only getting those with invm_cost_code = 'A' and not those that are null as I do when I run the query on Oracle. Note, if I change to left outer join, still get wrogn values. But, if I change to full outer join I get those = 'A' and those that are either null or 'C' as nulls (the 'c' come through as null. Any ideas?

Oracle Query

SELECT CITM_PROPRD, CITM_INV_SEQ, CITM_ITEM_SEQ, INVM_COST_FLAG, (CITM_QTY * CITM_PRICE)
FROM ACC_CUST_SUM, ACC_CUST_ITEMS, ACC_INV_MSTR
WHERE CSUM_COMP_CODE = 'A' AND
CSUM_EMPL_CODE = SUBSTR('85',1,2) AND
TRIM(CSUM_TERR_CODE) = TRIM('MB2') AND
CSUM_PROPRD BETWEEN '200610' AND '200611' AND
CSUM_PROPRD = CITM_PROPRD AND
CSUM_INV_SEQ = CITM_INV_SEQ AND
CITM_COMP_CODE = INVM_COMP_CODE(+) AND
CITM_ITEM_CODE = INVM_ITEM_CODE(+) AND
(INVM_COST_FLAG = 'A' OR INVM_COST_FLAG IS NULL)


Converted MS SQL Query

SELECT CITM.CITM_PROPRD, CITM.CITM_INV_SEQ, CITM.CITM_ITEM_SEQ ,INVM.INVM_COST_FLAG,(CITM.CITM_QTY * CITM.CITM_PRICE)
FROM ACC_CUST_SUM as CSUM
INNER JOIN ACC_CUST_ITEMS as CITM
ON
CSUM.CSUM_PROPRD = CITM.CITM_PROPRD AND
CSUM.CSUM_INV_SEQ = CITM.CITM_INV_SEQ

RIGHT OUTER JOIN ACC_INV_MSTR as INVM
ON
CITM.CITM_COMP_CODE = INVM.INVM_COMP_CODE AND
CITM.CITM_ITEM_CODE = INVM.INVM_ITEM_CODE AND
(INVM.INVM_COST_FLAG = 'A' OR INVM.INVM_COST_FLAG IS NULL)

WHERE CSUM.CSUM_COMP_CODE = 'A' AND
CSUM.CSUM_EMPL_CODE = SUBSTRING('85',1,2) AND
LTRIM(RTRIM(CSUM.CSUM_TERR_CODE)) = LTRIM(RTRIM('MB2')) AND
CSUM.CSUM_PROPRD BETWEEN '200610' AND '200611'

View 6 Replies View Related

Help Me In Converting Oracle Procedure To SQL Server

Sep 14, 2006

Hi All

Can any one help me in converting this from WHICH IN ORACLE to MS SQL SERVER


sqlplus -s $UserId/$PassWord@$DataBase <<EOSQL> $LogFile (This is the Connection String)

set serveroutput on
Declare
tempCnt Number:=0;
totDelCnt Number:=0;
Begin
Loop
$DelStmt
tempCnt := tempCnt+ SQL%ROWCOUNT ;
totDelcnt := totDelCnt+ SQL%ROWCOUNT ;

If SQL%NOTFOUND Then
Exit;
End if;

If tempCnt >= 50000 Then
Commit ;
tempCnt:=0 ;
End if ;

End Loop;
Commit ;
dbms_output.put_line('No of Recs Deleted From $TableName: '|| totDelcnt);
End;
/
exit
EOSQL

View 9 Replies View Related

SQLSERVER Syntax To ORACLE

May 3, 2002

DO you know how to convert the following SQLSERVER to ORACLE syntax:

SELECT *
FROM (ITEM_DATA RIGHT JOIN ITEMS ON ITEM_GUID = ITEM_GUID)
LEFT JOIN
IN_SHOP_HISTORY.ITEM_DATA_GUID = ITEM_DATA_GUID

ORACLE does not support JOINs

Thanks in advance,

Kathy

View 1 Replies View Related

What Is Rownum In SQLSERVER 7 As In Oracle

Nov 11, 2001

Hello,
How can this query be written in SQLSERVER 7 as it is written in Oracle.

SELECT rownum, column1 from XYZ;

This table returns two columns, first being the auto-generated sequence and second has the values in column1 of XYZ table.

I need to do similar in SQLserver 7 and I am new to it.
Please treat it as urgent..

Thanx

View 2 Replies View Related

Oracle RowID In SQLServer?

Mar 5, 2007

Hi,

In Oracle we have a datatype called 'ROWID' - Oracle uses this datatype to store the address (rowid) of every row in the database. Do we have any equivalent datatype in SQLServer similar to this ?

Regards,
Sn

View 11 Replies View Related

Migrate Oracle To Sqlserver

Oct 8, 2007

Hi

I am a Oracle DBA who is going to embark upon a
oppurtunity to migrate Oracle to sqlserver.

Can somebody give me tips for
Learning sqlserver2k5 for a Oracle DBA Books
Or Beginner DBA/Development Books for sql2k5

How good is the migration assistant from m$$ for
migrating from oracle to sql2k5

Does it migrate data as well as procedural code ?

Do you anything for me to watch out for best parctices
migration guides

You opinion would be higly appreciated


regards
db2hrishy

View 2 Replies View Related

Query Oracle -&> Sqlserver

Aug 14, 2007

select pippofrom(select person.name as pippofrom person)This query run in oracle....in sqlserver no!what can i do!?thank's

View 1 Replies View Related

SQLServer Equivalent For Oracle Query.

Nov 30, 2004

Hi,

Could anyone tell me what is the MSSQLServer equivalent of the following Oracle query?.

SELECT v1.cat, v1.gnr, TA1.desccde, v1.type, v1.cde
FROM view1 v1, table1 TA,
table1 TA1, table1 TA2, table1 TA3
WHERE
TA.txtcde (+) = TRIM(v1.cat)
ANDTA1.txtcde (+) = TRIM(v1.gnr)
ANDTA2.txtcde (+) = v1.cde
ANDTA3.txtcde (+) = TRIM(v1.type)

Thanks,
Gopi.
Follow your DREAMS...

View 3 Replies View Related

Oracle ,Sqlserver Table Sychronization

Jun 3, 2008

Hi All,



I am Currently doveloping a Asp.Net application.

I Need to Use two databases one is Sql server and another one is Oracle.



My Primary database is Sqlserver . But I need to get data from two tables from the oracle database also.



I would like to create the same table in Sqlserver and Update data from oracle (synchronize) automaticaly .



Is there any way to syhcronize these table to get the uptodate data.

What is the best solution to solve this situation.



Please show me example code.



By sqlserver way or .Net way

Please Help me .

Thanks you

M.S

View 2 Replies View Related

Equivalent Oracle Rownum In SQLServer

Jul 23, 2005

Hello,I would like to know if the equivalent Oracle rownum exist inSQLServer. Here is a sample SQL code to explain what I want to do :selectjobs.name,jobs.job_id,jobs.description,hist.message,hist.step_name,hist.step_id,hist.run_status,hist.run_date,hist.run_time,hist.run_durationfrommsdb.dbo.sysjobs jobs,msdb.dbo.sysjobhistory histwherejobs.job_id=hist.job_idand hist.job_id='E71CCB97-81C3-46E2-83FA-BFFCB66B47F8'order byrun_date, run_timeI just want the first or second row returned by this query. In Oracle Ican simply add rownum=1 or rownum=2 in the where clause to obtain thedesired answer. I don't know how to do in SQLServer.Thank in advance,Pierig.

View 4 Replies View Related

Book Contrasting Oracle And MS SQLServer?

May 23, 2006

I am an oracle savvy developer looking to switch to SS. Know of anygood books that compare/contrast the two?Thanks

View 3 Replies View Related

Changing DB Connection From SqlServer To Oracle

Jan 23, 2007

Hi

I am trying to switch between oracle and sqlserver databases to read the source data. I have used a parameter file to specify the connection parameters. For SQLserver the connection looks like in the file as below:

<?xml version="1.0"?><DTSConfiguration><DTSConfigurationHeading><DTSConfigurationFileInfo GeneratedBy="abvsh" GeneratedFromPackageName="Package" GeneratedFromPackageID="{8A304BF7-5325-4079-9D92-2B9BBF8793AA}" GeneratedDate="1/23/2007 4:46:08 PM"/></DTSConfigurationHeading><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[ConnectionString]" ValueType="String"><ConfiguredValue>Data Source=dl;Initial Catalog=PM_DW;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[Description]" ValueType="String"><ConfiguredValue></ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[InitialCatalog]" ValueType="String"><ConfiguredValue>PM_DW</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[Name]" ValueType="String"><ConfiguredValue>dl.PM_DW</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[Password]" ValueType="String"><ConfiguredValue></ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[ProtectionLevel]" ValueType="Int32"><ConfiguredValue>1</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[RetainSameConnection]" ValueType="Boolean"><ConfiguredValue>0</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[ServerName]" ValueType="String"><ConfiguredValue>dl</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[UserName]" ValueType="String"><ConfiguredValue></ConfiguredValue></Configuration></DTSConfiguration>

the pacakge runs fine. But when i change the connection to Oracle, it gives me error.

The config file looks like when i put oracle connection is as follows:

<?xml version="1.0"?><DTSConfiguration><DTSConfigurationHeading><DTSConfigurationFileInfo GeneratedBy="I2vshrivas" GeneratedFromPackageName="Package" GeneratedFromPackageID="{8A304BF7-5325-4079-9D92-2B9BBF8793AA}" GeneratedDate="1/23/2007 4:46:08 PM"/></DTSConfigurationHeading><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[ConnectionString]" ValueType="String"><ConfiguredValue>Data Source=pm62;User ID=pcm_62;Provider=OraOLEDB.Oracle.1;Persist Security Info=True;</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[Description]" ValueType="String"><ConfiguredValue></ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[InitialCatalog]" ValueType="String"><ConfiguredValue></ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[Name]" ValueType="String"><ConfiguredValue>dl.PM_DW</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[Password]" ValueType="String"><ConfiguredValue></ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[ProtectionLevel]" ValueType="Int32"><ConfiguredValue>1</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[RetainSameConnection]" ValueType="Boolean"><ConfiguredValue>0</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[ServerName]" ValueType="String"><ConfiguredValue>i2pm62</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[UserName]" ValueType="String"><ConfiguredValue>pcm_62</ConfiguredValue></Configuration></DTSConfiguration>



The error which i get when running from oracle source is this:

Information: 0x40016041 at Package: The package is attempting to configure from the XML file "C:oraTOsql-DataTXIntegration Services Project1Integration Services Project1Integration Services Project1 estConfig.dtsConfig".
SSIS package "Package.dtsx" starting.
Information: 0x4004300A at Data Flow Task, DTS.Pipeline: Validation phase is beginning.
Error: 0xC0202009 at Package, Connection manager "dl.PM_DW": An OLE DB error has occurred. Error code: 0x80040E21.
An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".
Error: 0xC020801C at Data Flow Task, OLE DB Source [1]: The AcquireConnection method call to the connection manager "dl.PM_DW" failed with error code 0xC0202009.
Error: 0xC0047017 at Data Flow Task, DTS.Pipeline: component "OLE DB Source" (1) failed validation and returned error code 0xC020801C.
Error: 0xC004700C at Data Flow Task, DTS.Pipeline: One or more component failed validation.
Error: 0xC0024107 at Data Flow Task: There were errors during task validation.
SSIS package "Package.dtsx" finished: Failure.
The program '[7264] Package.dtsx: DTS' has exited with code 0 (0x0).


Please let me know if you guys have any suggestion in what i am doing wrong.

Thanks,

Vipul

View 3 Replies View Related

Connection To Oracle / Sqlserver / Db2 Databases

Jan 23, 2007

Hi All,

Is there a way in SSIS to change the database connection to sqlserver or oracle or db2 without choosing the connection manager in the source.

For e.g. I ran a package which is reading data from sqlserver and later i want to connect to oracle to read the data but without changing the connection manager in the source.

Basically, i want to find out from you gurus is about a way to switch between databases without changing the connection managers. OR the only way is to make different sets of packages for oracle / db2 and sqlserver sources ?

Thanks,

Vipul

View 2 Replies View Related

QUESTION: Converting Oracle Shell Scripting From AIX To Windows

Jul 23, 2005

Hi, all...I have a sizeable database running under Oracle 9.2.0.4 under AIX5.2.0.I am faced with an impending move to a Windows environment, runningunder SQL 2000.Currently, we are heavy users of shell scripts, for exports, backups,etc.I am looking for viable scripting options under W2K/W2K3. Maybe sh/kshemulators, VB, Perl...?Scheduling of script operations is also required.Anyone been through this kind of move, who could offer some wisdom?Thanks!DW

View 19 Replies View Related

Admin A SQLServer Environment From An Oracle DBA Perspective?

Jul 20, 2005

Hey all,Recently we had a small re-org which combined DBA teams,specifically Oracle and SqlServer. Just wondering if anyone hasdocumentation/presentations, etc that show's how to admin a SQLServerenvironment from an Oracle DBA perspective?I guess, something that map's each DB's concepts to each other. Asan Oracle DBA how to troubleshoot/support the environment, etc....Thanks!Dave

View 4 Replies View Related

Common UPDATE Syntax For SqlServer And Oracle

Jul 20, 2005

The UPDATE table FROM syntax is not supported by Oracle.I am looking for a syntax that is understood by both Oracle and SqlServer.Example:Table1:id name city city_id1 john newyork null2 peter london null3 hans newyork nullTable2:id city23 london24 paris25 newyorkUPDATE table1SET city_id = table2.idFROM table1, table2WHERE table1.city = Table2.cityIf possible I do not want to have two different statements for Oracle andSqlServerPlease do not tell me that these tables are not normalized, it's just anexample!Thanks for any hints.Jan van Veldhuizen

View 8 Replies View Related

Importing Oracle Data In SqlServer Using Express

Nov 8, 2007

OK so there is some data in an Oracle DB that I have to summarize based on grouping info stored in a SqlServer DB. How can I import the Oracle data into a SqlServer temp table using SqlServer Express? Thanks.

View 2 Replies View Related

How To Copy The Content Of 3000 Oracle Tables Into SQLServer?

Nov 9, 2005

I have to copy a large (3000) amount of different tables from a Oracle machine into an
SQLServer machine.
I am able to do this using a (VB) script.
I use now several methods:

1) INSERT INTO TABLE1 SELECT * FROM SID1..DB.TABLE1 (SID1 is a linked server)

2) INSERT INTO TABLE1 SELECT * FROM OPENQUERY(SID1,'SELECT * FROM DB.TABLE1')

3) Also used OPENROWSET method (similar to 2)

For small tables this is fine, however for BIG tables (15M Rows/150Cols) the methods above are too slow.
If I compare the same copy action with a simple DTS, the DTS is 3 times faster.
Also, the DTS seems to bulk copy the data directly into the desired database while the
mentioned methods first fill the tempdb, then the transaction log of the desired database and
then finally the desired table (need very much extra space on your filesystem).
The total size of data is about 300GB.

Can anyone supply me with a simple example how to copy data from an Oracle table into a
SQLServer table in script (or SQL) that is as fast as the DTS and not filling my logfiles??
I read the bcp (which I use for import/export files) and bulk insert commands, but
I do not understand how to use them in this question.

View 14 Replies View Related

Oracle Empty String == NULL Behavior In SQLServer 2k5?

Feb 15, 2007

I'd like to have Oracle's empty string behavior in SQLServer 2k5. Oracle treats an empty string as NULL's.

In PL/SQL can do:
SELECT * FROM TABLE WHERE TABLE.FIELD IS NULL
... and it'd return rows containing NULL's as well as empty strings.

Can this be done? I couldn't find a setting for it.

Thanx

Peter

View 13 Replies View Related

Migrate Oracle Discoverer Reports To SqlServer 2005

Mar 12, 2008



Hello everybody.

Recently my boss decide migrate reports in Oracle Discoverer to SqlServer 2005 using Reporting Services..because SqlServer is less expensive than Oracle. ..
Well I don't know exactly How do I began? because it's new for me.
Any has experienced? Can you give any recomendations to migration?


Thanks.

View 1 Replies View Related

Linkserver Connection Fails Between SqlServer 2005 And Oracle 10g

Jun 18, 2007

This is what I did:



The instructions for changing the registry entries per previous MSDN postings were:

For Windows 2000
Oracle

8.1 [HKEY_LOCAL_MACHINESOFTWARE
MicrosoftMSDTCMTxOCI]
"OracleXaLib"="oraclient8.dll"
"OracleSqlLib"="orasql8.dll"
"OracleOciLib"="oci.dll"

Changed the registry entries on my WindowsXP machine:


entry name old value new values
"OracleXaLib" xa80.dll oraclient10.dll
"OracleSqlLib" sqllib80.dll orasql10.dll
"OracleOciLib" oci.dll oci.dll



Then created the Linkserver definition:



EXEC sp_addlinkedserver 'ORA10G', 'ORACLE', 'MSDAORA', 'ORA10G'
Command(s) completed successfully.

EXEC sp_addlinkedsrvlogin 'ORA10G', 'FALSE',NULL, 'scott', 'tiger'

Command(s) completed successfully.

Note:

scott/tiger is given as an example here; used my real userid/pw instead. BTW, I am able to connect

to the Oracle database using the userid/pw from the same host that is running the Sqlserver db.So, the

Oracle client software is installed and is working correctly.


Then attempted to query a table on the Oracle database:

select count(*) from ORA10G..<schemaname>.<tablename>




Got the following error message(s)

OLE DB provider "MSDAORA" for linked server "ORA10G" returned message "ORA-12154: TNS:could not resolve the connect identifier specified
".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MSDAORA" for linked server "ORA10G".


All the previous discussions and suggested solutions are all for SqlServer 2000 and Oracle8. But I did not see much discussions on SqlServer2005 and Oracle10g. Any help to resolve this problem will be appreciated.



Thank you.

View 15 Replies View Related







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