Tag: oracle

SQL Server version of Oracle's ADD_MONTHS()

In Oracle, you can use ADD_Months to add months on the fly in the sql statement. What is the MS SQL version. Oracle Example Select TestDate, TestFrequency, ADD_MONTHS(TestDate, TestFrequency) AS FutureTestDate FROM Tests Source : java’s website

Is Entity Framework tied to SQL Server?

What if I want to connect to Oracle, MySQL or even MS Access ?

What is the Sql Server equivalent for Oracle's DBMS_ASSERT?

DBMS_ASSERT is one of the keys to prevent SQL injection attacks in Oracle. I tried a cursory search…is there any SQL Server 2005/2008 equivalent for this functionality? I am looking for a specific implementation that has a counterpart of all the respective Oracle package members of DBMS_ASSERT. NOOP SIMPLE_SQL_NAME QUALIFIED_SQL_NAME SCHEMA_NAME I know the best-practices […]

PostgreSQL and/or SQL Server alternatives to Oracle's SYS_CONTEXT

Having used an Oracle DB for a while, I got used to using the Oracle DB Application Context to implement access restrictions. To simply put it, upon login a procedure is called that puts the user details into the Oracle Application context like so: DBMS_SESSION.SET_CONTEXT(‘context_name’, ‘user_id’, user_id); Then access can be enforced by creating views […]

Executing an Oracle Stored Procedure from SQL Server 2005

how do we execute an Oracle Stored Procedure from SQL Server 2005? As part of a SQL Server scripts we need to execute an Oracle 10g Stored Procedure and download data to SQL Server 2005

What are the best practices for migrating an Oracle 10g database to Microsoft SQL 2008 R2? Application is using Hibernate

Basically what the title says. Going forward, we need to start supporting both database platforms (and will start writing migrations accordingly), but we need to do the first initial “port”. Our DBAs are confident they can convert the schema, tables, data types, etc. but our developers have less confidence that the DAOs will “just work”. […]

Oracle DB: Return second query if first query is empty

I am writing an Oracle stored procedure to return the results of a database query. If the query does not produce any results, a second query must be run in its place. In SQL Server, I can accomplish this using something similar to the following: INSERT INTO @TableVar SELECT <joinQuery1>; IF (SELECT COUNT(*) FROM @TableVar) […]

How do I convert an Oracle TIMESTAMP data type to SQL Server DATETIME2 data type while connected via Link Server.?

I have tried some examples but so far not working. I have a Link Server (SQL Server 2014) to an Oracle 12C Database. The table contain a datatype TIMESTAMP with data like this: 22-MAR-15 04.18.24.144789000 PM When attempting to query this table in SQL Server 2014 via link server I get the following error using […]

Parameterized SQL, ORACLE vs SQL Server with regular expression

Oracle and Sql server using different prefix for parameters in parametrized string. Sql using @p1 ORA using :p1 I would like to use in my SQL just @ and in case that ORA database is used all : character should be replaces with @. Can you please help me to create regular expression? Here is […]

How to combine IN operator with LIKE condition (or best way to get comparable results)

I need to select rows where a field begins with one of several different prefixes: select * from table where field like ‘ab%’ or field like ‘cd%’ or field like “ef%” or… What is the best way to do this using SQL in Oracle or SQL Server? I’m looking for something like the following statements […]

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