Categories
Database Development

Append String To Int

I need to add a % sign to a calculation I’m doing in MS SQL Server. This is the syntax I am using Cast(Round(Coalesce(totalsaleamt,0) * 100,0) As Int) + ‘%’ but I get the error Conversion failed when converting the varchar value ‘%’ to data type int What is the proper way to make this […]

Categories
Database Development

How can I model this schema in MySQL?

I asked this in the DevOps forum, but this is probably a better one for this question. I want to create a schema that reflects the following relationships, and I’m trying to do this in MySQL Workbench. (I’m no DB expert) I have 3 environments – sandbox, staging, and production I release a product version […]

Categories
Database Development

Why MySQL 5.7 replication is verry slow on my new server

I have a problem with MySQL replication and I wanted to find advice or information on it. Let me show you the infrastructure. Master: This is our main MySQL server. I want to replace it by Slave B. Slave A: This is our replication server connected to the Master. There are no issues with this […]

Categories
Database Development

Login oracle database with Microsoft Active Directory error

I have two machines, one (let’s call it dbmachine) has the database and client installed of oracle 11g release 2, the other one is the domain controller (let’s call it dcmachine) and has the client installed, same version. They are in the same network and both can communicates with each other, usign ip or hostname. […]

Categories
Database Development

Login oracle database with Microsoft Active Directory error

I have two machines, one (let’s call it dbmachine) has the database and client installed of oracle 11g release 2, the other one is the domain controller (let’s call it dcmachine) and has the client installed, same version. They are in the same network and both can communicates with each other, usign ip or hostname. […]

Categories
Database Development

DB2 replace emoji in text string

I trying to find a way to replace emojis within a text string, I want to be able to set a pattern of (a-z) and (0-9). if the string has other characters that don’t match that pattern, i want to replace them with a space. Any help would be greatly appreciated. Thanks.

Categories
Database Development

Postgres index on timestamp column not utilized

I have a database with a column called timestamp of type timestamp without timezone, there is a btree index on this column. I have a query as below SELECT * FROM employee WHERE timestamp >= timestamp ‘2020-01-27 13:24:09’ However, the explain analyze shows that the index on the column timestamp is not used: Seq Scan […]

Categories
Database Development

Handle development issues when dealing with different collation for the instance/database setting

Looking for some guidance on how we can handle the scripts/schemas when being run on different collation in sql server. We have a process where multiple stored procs are created lets say with schema sales. Therefore all related tables and procs for that within database are stored as sales.table1, sales.table2 … etc and stored procs […]

Categories
Database Development

Is there a way to prevent SQL Server resetting itself back to read-write mode?

I’m working on a desktop app which is installed along with a database, and then connects to the database using SQL Server LocalDB when a user runs the app. The workflow is: When the app starts, it creates and starts a named, user-specific SQL LocalDB instance. When the user chooses a database, the corresponding MDF […]

Categories
Database Development

Is there a way to prevent SQL Server resetting itself back to read-write mode?

I’m working on a desktop app which is installed along with a database, and then connects to the database using SQL Server LocalDB when a user runs the app. The workflow is: When the app starts, it creates and starts a named, user-specific SQL LocalDB instance. When the user chooses a database, the corresponding MDF […]