How do i get a certain string from a column in sql

Column name Subject Value = Something TEST001 something I need to get TEST001 from “Something TEST001 Something” If there are spaces or any specials characters after the 1 of TEST001 they will be removed. I only have this SELECT Subject , REPLACE(SUBSTRING(MailSubject, CHARINDEX(‘TEST’, MailSubject), LEN(MailSubject)),”, ”) AS Assingment FROM AssingmentEmail The numbers from TEST001 can […]

2 rails apps – shared data using common engine

I’ve started off with a single Rails application. Very simple, largely read-only, front end for a line of business application (using view backed to retrieve data) – with a few standard tables to augment the views. I now have a need to use the same set of data in a new application (the 2 applications, […]

How to resolve “MSOLAP.4 Provider is not registered on the local machine” error without install SQL in local machine?

If I am run OLAP application in SQL installed machine (Machine A), it will work perfectly. But I need to run that application in another machine (Machine B) with Machine A’s MSOLAP DLL. Is it possible? If yes how can I do that? Answer: I have fixed this issue by using Adomd connection instead of […]

SQL Server localdb. Confusion about two MDF files

In my WPF/C# app, I recently installed localDB v.11 via nuget. Then I created a .MDF file in the root of my project. When I run the app, the CRUD operations work fine, but they all are carried out on the database created in the bin\debug folder. Nothing changes in my root .MDF file. Please […]

codeigniter add N in sql Query INSERT unicode text

I am working with codeigniter / SQL. Where I want to insert unicode string with ‘N’ Prefix the insert. How can I achieve it in regular insert. Regular Code: $data = array( ‘title’ => ‘My title’ , ‘name’ => ‘My Name’ , ‘data’ => ‘My data’ ); $this->db->insert(‘mytable’, $data); INSERT Trying to Achieve: INSERT INTO […]

Join two table using sql query

I have two table with records, one is temp, second one is temps, i want to update the status by department wise which is provided in the second table, I need the first table counts will be update in the second table NotYetTaken, WorkInProgress, Completed according to the status…. For Example, care dept wil be […]

Using parameters for search

I have the tables customer – with customerid and phone number, and calls – with phone numbers and date. I need to find the customer’s phone number in the calls table. now the thing is – in the calls table the phone number can be in different ways- If I need to search for one […]

Azure SQL query slow

I have setup an Azure SQL database. My goal to to evaluate it for use on a real project. I have a simple query that is very slow. select * from table1 T1 join table2 T2 on T1 .T2_id = On my laptop SQL Server this is sub-second but in azure it’s 11 seconds. […]

Listing Number Of Rows based on Quantity

I have a query running on SQL Server 2008 and I am facing a problem that it exceeds the maxrecursion limitation, and I don’t know an alternative way to do it. Let me explain this: this query is listing the number of rows for each MfgPN based on the ShipQuantity. For example, if MfgPN is […]

How to make different SSIS packages sequential to avoid locking?

I have two different SSIS packages (ABC,XYZ) running on a same server. I want the package XYZ to run only if package ABC is not running. Also I want XYZ to wait till ABC completes execution & start execution once ABC completes. ABC runs after every 20 minutes (genrally finishes in 20 minutes but sometimes […]

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