I have to replace special characters in SQL. My problem is with ‘, because it is used for start and end of string in SQL. I tried: ID = REPLACE(ID, ”’, ”) ID = REPLACE(ID, “‘”, “”) But both not …
Tag: sql-server
How to look for missing rows within a group?
Consider the data below. I am trying to find situations where in a specific RequestID, there is an Attempt: 0, but Attempt: 2 is missing. I’ve tried looking for Attempt: 0 with a WHERE predicate …
Return Table Object from Stored JSON in a Column
I am sorry, I know this has been asked a billion times but I have tried to put together CROSS APPLY statements without any luck and needs some help. I have this data in SQL in a single column which I …
SQL SSRS How to drill down State into top three cities. Do I do it in SQL or SSRS?
I am creating a simple report where I have a location (down to the city level) and some information about that city in regards to my customers. Here is what the table look like Now what I want to …
Fade in SQL results with jQuery
I have a php file that I have pulling in SQL elements from my database. My goal is that for each row of data that the div ‘moredetails’ would fade in on click (one at a time). However, the current …
Create an UPDATE statement for every row in a table
I want to update a table on one server with data from a table on another server. The tables have the same columns and I just want to sync the data. I have earlier made a script that creates insert …
Eror While Executing a dynamic queries in a variable
I’m executing a dynamic query from a variable but it always says: Could not find stored procedure I have tried to use simpler queries like set @query = ‘select * from [table_name]’ but it gives the same error. In my temporary table is the list of all my trigger name so the expected output I …
Given a long/lat, convert meters into longitude/latitude degrees
I have a longitude and latitude stored as a geometry with SRID 4326. I want to make a line that is exactly 1000 meters long that is 90 degrees (to the right). I know that the conversion from a …
How does a SQL query transform the data?
I came across this question and was trying to understand how the answer given there is actually transforming the data. Input Table +———+——-+—————+ | user_id | State | …
What happens when we add new records to a SQL table while the Azure Search Indexer is running
Say for example that I’ve got an Indexer running every day and it pulls down 2 million records from the SQL table every time it gets run. It takes around 30 min to finish off. During that time we keep …