0
votes
1answer
32 views

Integrating legacy Ruby on Rails system with new ASP.NET system

My client has an existing web application (System A) which was built with RoR/PostgreSQL (hosted on linux), and now wants to have a new ASP.NET application (System B) that will integrate with it. The ...
-4
votes
1answer
27 views

What keyword to use in place of table in postgres [closed]

CREATE Proc [dbo].[AbnormalODoMeterReading] as begin set nocount on Declare @TableDevice table
0
votes
1answer
18 views

Good way to copy data from SQL Server to Posgres

I am using OPENQUERY through an ODBC connection to insert records from SQL server to Postgres. But it's very slow - a few minutes for 10000 records. Also, SQL Server Service crashes when amount of ...
1
vote
1answer
35 views

Converting a script from MSSQL to PL/pgSQL

I just started working with the EVE static dump, which is just a lot of tables with data about the game, such as a list of what solar systems connect, which is what I'm dealing with. I want to make a ...
0
votes
1answer
39 views

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 ...
0
votes
2answers
111 views

LIMIT SQL query per GROUP BY

I have 20 classroom, each classroom has 50 students. is it possible to find 10 best students in each classroom in a single query statement? The table "klas": int id int cla_id int stu_id int ...
0
votes
1answer
110 views

Portable SQL : unique primary keys

Trying to develop something which should be portable between the bigger RDBMS'es. The issue is around generating and using auto-increment numbers as the primary key for a table. There are two topics ...
-2
votes
3answers
78 views

Sql Result IN a Query

dont blame for the database design.I am not its database architect. I am the one who has to use it in current situation I hope this will be understandable. I have 3 tables containing following data ...
3
votes
4answers
60 views

Place a footer row as an header row of a group of rows

I have a table like the following : rfa_yea | rfa_idx | rfa_dsp | rfa_tpr ...
0
votes
1answer
151 views

Importing data from Postgres to Microsoft SQL Server 2012

I'm being demanded to develop a new software that must be built over SharePoint and use Microsft SQL Server 2012. I have a DB in Postgres, and some of its tables will be used in this new project, so ...
2
votes
2answers
129 views

Exporting data from SQL Server to PostgreSQL

I am using this example to export data from SQL Server to PostgreSQL, when I start the export as 300,000 rows takes 12 minutes, what I can do to speed up this process or you know another way to do it? ...
3
votes
1answer
143 views

How to link from Postgresql to SQL Server via ODBC?

I need to be able to query a SQL Server database from within Postgresql. The Postgres instance is running locally and the SQL server set up as an ODBC data source. How do I add this as a linked ...
-1
votes
1answer
198 views

PostgreSQL vs MS SQL Server compatibility with java [closed]

I have to design a Java Application, which has database connectivity as well. I am unable to decide which database should i use? "PostgreSQL" or "SQL Server 2008". I want to know which has better ...
1
vote
3answers
169 views

Is a query with over 50 joins slow?

I am planning to develop an application using the EAV design. I have done a lot of research on EAV and the sixth normal form. I have even talked to people at work and they say avoid both approaches if ...
1
vote
2answers
133 views

Converting SQL Server 2012 schema to PostgreSQL 9.1

For a new project we have to export data from a SQL Server 2012 database to a PostgreSQL database. We have the SQL Server schema but have to create one for PostgreSQL. As far as possible we would ...
1
vote
3answers
161 views

Copy result of SQL Server query to Excel

I'm trying to figure out a way to copy the result of a SQL Server query to Excel. I know that with PostgreSQL, you can execute the following command: COPY (SELECT id, summary, description FROM table) ...
-4
votes
1answer
177 views

Why is the LIMIT clause not supported in SQL Server?

It's easy to do pagination using mysql or postgresql by using the LIMIT x,y clause. However it is not supported by Oracle or MSSQL. Any insights on why? I'm not asking for alternatives, I'am aware ...
1
vote
2answers
128 views

query SQL Server from PostgreSQL

There are SQL Server 2008 R2 and PostgreSQL 9.2 under Windows (currently XP SP3). How can I query SQL Server from PostgreSQL? No problem when SQL Server->PostgreSQL via Linked Server. Searching web I ...
0
votes
1answer
103 views

Inserting unique value into database PGSQL/MSSQL

I'm trying to insert unique records in a MSSQL and Postgresql DB using insert into where not exists. But I am getting a incorrect syntax error as seen below. What am I doing wrong? INSERT INTO ...
1
vote
2answers
493 views

Adding named foreign key constraints in a SQL Create statement

I currently have: CREATE TABLE galleries_gallery ( id INT NOT NULL PRIMARY KEY IDENTITY, title NVARCHAR(50) UNIQUE NOT NULL, description VARCHAR(256), ...
1
vote
1answer
170 views

Postgres update from left join

I'm new in PostgreSQL and trying to convert a query from SQL Server. I have a table Users with, among others, the columns bUsrActive, bUsrAdmin and sUsrClientCode. I want to update Users and set ...
0
votes
1answer
47 views

Accessing data on Microsoft SQL Server from a PostgreSQL function

I have an application that uses PostgreSQL but also interacts with a third-party-controlled database on MSSQL. The data are sometimes tied together closely enough that it becomes desirable to do ...
2
votes
1answer
202 views

SSIS data transfer adding characters (SQL Server to Postgres)

I've created an SSIS package that takes geography data out of a SQL Server database and copies it to a geometry column in a Greenplum Postgres database. I'm doing it in a roundabout way because of ...
1
vote
1answer
3k views

'stuff' and 'for xml path('')' from SQL Server in Postgresql

I'm migrating some SQL Server 2008R2 queries to Postgresql 9.0 and I have some trouble with it. Here's the SQL Server query: stuff((select ', '+p.[NAME] as 'data()' from BPROVIDERS_PROVIDER p, ...
4
votes
2answers
380 views

Postgresql equivalent to SqlServer Group By with RollUp

I have a Sql Server Query that is using RollUp function while grouping I want an equivalent query in postgresql , Query in SQl server is : SELECT (CASE WHEN acnt_dba_name Is Null THEN 'Total' ELSE ...
0
votes
1answer
103 views

Convert SQL-Server specific INSERT query to PostgreSQL

I have a SQL Server 2008 specific query how can I execute same query in PostgreSQL. INSERT INTO profile_answers_new (pro_ans_frn_pro_id, pro_ans_name) SELECT pro_ans_frn_pro_id = @new_pro_id , ...
3
votes
1answer
74 views

SQL standard in SQL Server and postrgesql

does anybody can explain to me why this statement returns columns which are FK in SQL Server but in postgresql returns nothing? Table is identical on both RDBMS and do have FKs select * from ...
1
vote
2answers
470 views

psqlODBC won't load after installing MS SQL ODBC driver on RHEL 6

I had the PostgreSQL drivers working on my RHEL 6. But after I installed Microsoft® SQL Server® ODBC Driver 1.0 for Linux I can no longer connect to PosgreSQL data sources. I can connect to SQL Server ...
-3
votes
2answers
155 views

SQL transactions run on Postgres 9.0 but one is aborted on SQLServer 2005

Suppose we try to run concurrently the following two transactions: T1: BEGIN UPDATE place SET state_code=5 WHERE state_code=6 AND type='town' COMMIT T2: BEGIN UPDATE place SET ...
0
votes
1answer
105 views

Method for cascading soft deletes in parent-child relationships

I have a simple schema in which soft deletes are used (that's how it is designed and that can't be changed). There are two tables that participate in the schema: Company (id, is_deleted) and Employee ...
0
votes
0answers
134 views

SQL Server stored procedure like PostgreSQL stored procedure [duplicate]

I want to create a stored procedure in SQL Server that is like PostgreSQL stored procedure. SQL Server: table1_test field1 field2 aaaa bbbb table2_test field1 field2 cccc dddd ...
1
vote
1answer
159 views

Alternative to SQL Server's sysobjects in PostgreSQL

I am porting a database from SQL Server to PostgreSQL. Is there any alternative to sysobjects in PostgreSQL? If so, then what is it and how can be it used? My view: create view int_objects_v as ...
0
votes
2answers
61 views

routing network function issue

Following on from a this question, I have some dynamic SQL I'm running successfully in PL/PgSQL with EXECUTE, but it doesn't seem to have the intended effect. The following code is part of a plpgsql ...
0
votes
1answer
168 views

Configuring Quartz for database servers

I am using Quartz scheduler version 1.5.2, the schedules are stored on a MSSQL database. Quartz is running in a cluster mode with the property - org.quartz.jobStore.selectWithLockSQL = select ...
0
votes
1answer
184 views

How can I create a dblink from Postgresql 8.3 to SQL Server (2000 and 2008)?

I have a Postgresql database that need to read data from two SQL Servers (one SQL Server 2000 and one SQL Server 2008). I want to setup two dblinks to the SQL Servers. After googling, foruming, ...
-1
votes
1answer
127 views

Best Syncing Databases across multiple platforms [closed]

I am designing an application that will clients on windows, wed, driod, iOS, and windows phone. I am in a conundrum about what is the best database to use and what is the best architecture approach ...
2
votes
4answers
173 views

Group records by range

I need to select a count of items that fall into some range like this create table numbers (val int); insert into numbers(val) values (2), (3), (11), (12), (13), (31); select count(1) as qty , val ...
6
votes
2answers
165 views

Do the results of a SQL query explain depend on the size of the database?

My application is using JPA with Hibernate and I see that hibernate generates some interesting SQL queries with a lot of joins in my log files. The application does not have a lot of users right now ...
4
votes
2answers
588 views

Do SQL bind parameters affect performance?

Suppose I have a table called Projects with a column called Budget with a standard B-Tree index. The table has 50,000 projects, and only 1% of them have a Budget of over one million. If I ran the ...
3
votes
3answers
432 views

Any disadvantages to bit flags in database columns?

Consider the following tables: CREATE TABLE user_roles( pkey SERIAL PRIMARY KEY, bit_id BIGINT NOT NULL, name VARCHAR(256) NOT NULL, ); INSERT INTO user_roles ...
5
votes
1answer
87 views

cross server, standard SQL to produce a comma delimited list

I've been looking but can't find anything. Is there a SQL standard compliant way to produce output like this TSQL? I would like a single query that would work just as well on sqlite, mysql, postgresql ...
1
vote
2answers
49 views

Finding Last known occurence given a lookup date in Large dataset

I have a specific design question that has been plaguing me for quite some time. I have a large realtime GPS Location Log table containing point entries for many thousands of assets. Points come into ...
0
votes
2answers
262 views

Database within a database (table design) [duplicate]

Possible Duplicate: Database design to create tables on the fly I have a need to create a database within a database. This question is related to this. I will attempt to explain what i am ...
0
votes
5answers
309 views

Database design to create tables on the fly

I need to create dynamic tables in the database on the fly. For example, in the database I will have tables named: Table Column DataType TextData NumberData DateTimedata BitData Here I can add a ...
0
votes
1answer
490 views

Convert postgres to SQL Server

I have an SQL file generated from a Postgres database that I want to run on SQL Server 2008. The SQL file creates, drops and inserts data into tables. SQL Server returns a number of errors in the ...
8
votes
1answer
459 views

How to create ordered index with liquibase?

I am wondering if there is a generic way to create an "ordered index" with liquibase. Something that will produce these kind of SQL statement: CREATE INDEX idx_name ON my_table (m_column DESC) I ...
0
votes
0answers
273 views

Convert SQL Server procedure to PostgreSQL function (T-SQL to PL/pgSQL) [closed]

I have create the following function in SQL Server and now I want to do the same in PostgreSQL but I don't know the syntax to adapt it ALTER PROCEDURE [dbo].[MyProc] AS BEGIN delete from MyTable ...
0
votes
1answer
149 views

How can I select and insert BLOB between different databases using python?

I have some SQL Server tables that contain Image data types. I want to make it somehow usable in PostgreSQL. I'm a python programmer, so I have a lot of learn about this topic. Help?
2
votes
3answers
351 views

Insert failed, but identity value grows, does this break the Atomicity rule?

When I importing data to a new table from a large excel, if one record failed, then nothing is imported. I think it's ok because it meet the Atomicity rule. However, when I fixed the source data error ...
1
vote
2answers
207 views

SELECT query poor execution plan with “WHERE A=1 OR A=2 clause”

We currently have a LOGS TABLE divided with multiple logbooks numbers (column XLOG), and accessed within a limited time range. The table is declared with a clustered 'natural' primary key, where XLOG ...

1 2 3 4 5
15 30 50 per page