Tag: mysql

Using MSSQL and MySQL database both as entity framework 6 model

I’m new to work with MySQL with asp.net and I’m trying to use asp.net mvc 4 and entity framework 6 to view datas from MySQL & MSSQL database both. So far MSSQL is working fine. But whenever I try to view datas from MySQL tables I get this error, Schema specified is not valid. Errors: […]

Retrieving data from database in Visual C#

Background I am writing my first c# application, and would like to display the results of an SQL query in my application. I would like the query to run against the database on a button click event. The results are to be displayed as read only and I would like them to be displayed in […]

Compute a column based on the comparison of two queries

I am trying to compute a column based on the comparison of two queries. Take for instance these two queries that use the same table. The only difference is the dates. -Query for Monday |Balance: 1,000 -Query for Tuesday |Balance: 900 After comparison the column I am attempting to create should be this ( based […]

MySQL get average from result, average must be between 8 and 12

So I am trying to create an MySQL query to get the average of the RANK id, and it must be somewhere between 8 and 12, otherwise the query will select 5 random player names until the RANKVALUE is averaged between 8 and 12. select summonername from (select rankvalue from players group by summonername having […]

Select min value with specific where filters MYSQL

I have a little trouble with my subquery. I try to only take the nearest event in a table with a min value, but I need it to be confirmed (confirmed = 1 and cancelled = 0) There’s my table : uid | location | date | open | close | confirmed | 1 | […]

Error in SQL syntax Can seem to find the right query

Im having trouble I cant seem to make my sql query right Dim command1 As New MySqlCommand(“UPDATE userscanner SET Username ='” & txtbox_username.Text & “‘,Password='” & txtbox_password.Text & “‘ WHERE ID = ‘” & lbl_id.Text & “‘)”, Connection) command1.ExecuteNonQuery() MsgBox(“Profile Successfuly Saved”) Me.Close() but i have a error that says ” you have an error […]

Migrate a Trigger from MS Sql TO MySql

I would like to convert this MS sql trigger to MySql.My issues are: NOT FOR REPLICATION : update() function: I don’t have any idea how to add that same functionality in MySql.Following is the SQL Server Trigger code.please help. CREATE TRIGGER [trigger_name] ON [dbo].[table_name] for INSERT,UPDATE NOT FOR REPLICATION AS BEGIN SET NOCOUNT ON; if […]

Collation issue with linked servers SQLServer and MySql and Incorrect String Value

Setup Have an SQL Server connecting to Mysql as a linked server. Periodically a SQL Server Agent Job calls a stored procedure (SP) to check a flag in a SQL Server table, pass the contents (via a temp table) of unflagged rows to a SP in the mySQL db, flagging the original SQL Server records […]

Implement an efficent mechanism to check whether a record is referenced in other tables before delete

I am developing an web app using asp.net. I am making this app for compatable for both SQL and MYSQL DB. So my concern is think that I have a set of records in a table. This table’s records are referenced by other tables. So if a user try to delete a record from this […]

Temp table to get the value from a Table using UNION

I HAVE a table name Book , Statement, Chapter, Section, Post. The Post table has a Column name DisplayMessage which i need to get a distinct record of. 2 ways it can be mapped in UI First way is Book , Statement, Chapter, Section, Post. OR Book , Statement,Chapter, Post. (Post has the Column “Message”) […]

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