Tag: oracle

Analog of OUTER APPLY in other RDBMS (not SQL Server)

I’m using SQL Server at work, and I have some nice tricks with OUTER APPLY clause which helps me do not repeat code. For example, if I have a table like this: create table Transactions ( ID bigint identity(1, 1) primary key, [Date] datetime, Amount decimal(29, 2), Amount2 decimal(29, 2) ) insert into Transactions ([Date], […]

SQL Server Migration Assistant for Oracle truncating text at 100 chars

I’ve been trying unsuccessfully to migrate an oracle database to sql server 2005. The problem I’m seeing is with migration of Oracle “LONG” text to SQL varchar. I only get the first 100 characters of data from the field I’m checking in the Oracle database after the migration completes. I can see data past 100 […]

Export Users, roles and grants into a CSV file

I need to extract the users into CSV file and upload it into the role modeller to design an effective security model. Now the question arises how do I export users, roles and grants into a CSV files on MS SQL and Oracle?

Optimistic Concurrency in Entity Framework between Oracle and T-SQL

I am building EF Code first POCOs that’ll be used between an Oracle back-end and a MS SQL Server backend. I’m having a problem finding the right way to tackle a Timestamp property that’ll work on either database back-end. MS SQL Server would have me use a common property like this: 1506510036 public byte[] Timestamp […]

Entity Framework : Schema specified is not valid

I am developing a web application that is using Entity Freamwork 5 Visual Studio 2012 and it need to support both SQL Server and Oracle database providers. I created entity model for Oracle Database. I thought it would work after some changes in connectionstrings, bu no it is not that easy .. I found this […]

Retrieve only distinct combinations

I’m having column as Node varchar(25) in MS-SQL Server. The possible values are node —– D-C C-B B-A B-C B-E C-A A-B A-C C-D etc. I want to retrieve the the distinct combinations from it. E.g.: node —- D-C C-B B-A B-E C-A Please tell the SQL for this.

How can I use Dapper in a multi database environment?

I’m trying to implement simple queries like SELECT * FROM TABLE_X WHERE XID = @id, but the problem that I’m having is that these queries would run on different databases (SQL Server and Oracle) for different application instances. How to do it without to have to write each database a new set of queries?

C# SqlBulkCopy resume on error

I am trying to do a bulk insert of 10 million of rows from Oracle to SQL Server using BulkCopy.WriteToServer(). I have made sure The table columns and data types on both sides are the same. I meant Oracle’s Date data type maps to the Sql Server’s datetime data type. Varchar2 maps to varchar, etc. […]

Varchar to Number in sql

i have written a query in which i am fetching an amount which is a number like ‘50,000’,’80,000′. select Price_amount from per_prices As these values contain ‘,’ these are considered to be varchar.Requirement is to to print these as ‘number’ with ‘,’ that is how can ‘50,000’ be considered as number and not varchar

How can I get a date from SQL Server into Oracle 12c? Dates are being inverted (backwards)

I’m having a real problem getting a date from SQL Server into Oracle while maintaining the correct value. The value in SQL Server looks like: “Apr 28 1969 12:00AM” When I pull this value into a .NET DateTime it looks like: “04/28/1969 12:00AM” When it gets inserted into Oracle it looks like: “28-APR-19” The Oracle […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.