I am trying to insert data into my database but I want the data to be assigned to all numbers indicated by profile_id. My table is called “profile_meta” So the table structure is: profile_id …
INSERT or UPDATE from another table in mysql
I have two tables, with same schema – create table test1 ( a INT NOT NULL , b INT NOT NULL , c INT, PRIMARY KEY (a,b) ); create table test2 ( a INT NOT NULL , b INT NOT NULL , c INT, PRIMARY KEY (a,…
Link To Entities, how to fix Startswith resolving to sql CHARINDEX and ignoring index
I have the following model I’m calling this function The above is trying to reproduce the following sql However it’s generating the following nasty piece of work: As you can see, it’s generating CHARINDEX for the StartsWith. The problem is this is ignoring all the indexing I have setup, and …
How to use % operator from the extension pg_trgm?
I have my pg_trgm module installed. The schema set is extensions. To use it I have to run something like this select: I’m trying to run a statement using the % operator and got the following message. What is necessary to run % or <-> operators? Answer Most probably the problem is with the search_p…
ORA-01219: database not open: queries allowed on fixed tables/views only
I Am using oracle 11g and SQL developer tool. When i tried to retrieve rows from db i am getting error message as :- I looked for sgadef.dbf file and it was missing in home directory.. Can someone help me to make it working. Answer First of all check the status of the instance you work with (this may need
Error dropping or deleting a user from SQL Server 2012
I’m trying to drop all the logins from SQL server except the default built-in SQL server logins but I’m unable to drop the “administrator” account. It gives me an error : “Server principal ‘…
Time zone conversion in SQL query
I am using a query to get some application Received Date from Oracle DB which is stored as GMT. Now I have to convert this to Eastern standard/daylight savings time while retrieving. I am using the below query for this: It works fine for Standard time. But for daylight savings time we need to convert it to &#…
Execute a Stored Procedure Inside a View?
I started working for a company a few weeks ago, and have inherited a crazy mess of databases. I’m currently working on designing the new systems to replace their older ones. The previous developer created a ton of views that are entirely identical, with the only differences being the conditions within …
How can I get a plain text postgres database dump on heroku?
Due to version incompatibilities of my postgres database on heroku (9.1) and my local installation (8.4) I need a plain text sql database dump file so I can put a copy of my production data on my …
Should I create separate SQL Server database for each user?
I am working on Asp.Net MVC web application, back-end is SQL Server 2012. This application will provide billing, accounting, and inventory management. The user will create an account by signup. just …