Tag: oracle

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 here The mechanism used to generate the auto-increment numbers. How to specify that you want to use this as the primary key on […]

SQL Server/Oracle table writable only by a trigger?

I am wondering if is there a way to make a table writable only by an specific trigger in SQL Server or Oracle DB. Just to make an example: Table: “Operation” ID | Date | Account1_ID | Account2_ID | Amount Table: “Transactions” ID | Date | Account | Debt | Credit What I want to […]

REGEXP_LIKE conversion in SQL Server T-SQL

I have come across this line in an old report that needs converting to SQL Server. REGEXP_LIKE (examCodes, learner_code) examCodes being the source and learner_code being the pattern. I know that SQL Server doesn’t have REGEXP_LIKE and most places tell you to use PATINDEX. Here’s me thinking that this would work: PATINDEX(learner_code, examCodes) But I […]

best way to migrate a windows forms application from sql server to oracle

I looking for a best way to migrate a Windows Forms application from MS SQL Server to Oracle. The table schema is recreated in oracle allready and the data was copied into Oracle tables. The App uses ADO.NET Datasets to access the DB. So, should I just kind of replace all references to SqlDataAdapter with […]

SQL Agent Job – Connection may not be configured correctly or you may not have the right permissions on this connection?

I’m getting this error when running an SSIS package through SQL Agent Failed to acquire connection “ORACLE ADO.NET”. Connection may not be configured correctly or you may not have the right permissions on this connection. When I log on as the SQL Agent User and run the ssis package directly it is fine. When I […]

How to find the ODBC driver name for a connection string?

Whenever I use ODBC drivers with a full connection string, and not just a DSN entry, I often get an error similar to this Data source name not found and no default driver specified I have the correct syntax of the connection string (or so the Internet says), but I suspect I don’t know the […]

how to select n rows

i have a database about several companies which include their name, price of share, %age change: NAME PRICE % CHANGE ————————————————- a 67 11 b 23 6 c 456 5.89 d 112 23.98 e 31 17 f 78 3.09 g 2678 12.56 h 357 4.6 i want to select top 5 rows %age wise,means which […]

Line number in sql server like LINE in USER_SOURCE oracle

I am trying to findout impact if i change some stored procedure code. In oracle i used to do like select NAME,TEXT,LINE from USER_SOURCE where upper(TEXT) like ‘%SEARCH_STRING%’ in sql server i tried as SELECT DISTINCT so.name,sc.TEXT FROM syscomments sc INNER JOIN sysobjects so ON sc.id=so.id WHERE sc.TEXT LIKE ‘%SEARCH_STRING%’ Is there any way to […]

Variable manipulation in Oracle

So I’ve been digging around on the net all afternoon to find the answer to this. I have a table that looks like so: CREATE TABLE ldap_domains ( domain varchar(128) NOT NULL, name varchar(16) NOT NULL, description varchar(32) NOT NULL ) ALTER TABLE ldap_domains ADD CONSTRAINT pk_domain PRIMARY KEY (domain); INSERT INTO ldap_domains VALUES (‘test’, […]

SQL – Insert if the number of rows is greater than

I have created a SQL query that will return rows from an Oracle linked server. The query works fine and will return 40 rows, for example. I would like the results to only be inserted into a table if the number of rows returned is greater than 40. My thinking would then be that I […]

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