Background is I’m making a SQL connection that takes a .csv file and imports it into a SQL Server database table. The problem I’m running into is, I’m having trouble with the query syntax because …
Tag: sql-server
How to order occurrences counting from 1 to n occurrences
I have a table that contains several columns, but for the task, the important ones are id end created_date, where id can repeat. Sample data: +——–+————–+ | id | created_date | +——…
Is there a way to compare Lat/long of two tables
I have two tables: address_points kmldata address_points table columns: ID address Latitude1 Longitude2 kmldata table columns: Locname Lat Long Now I want to …
Is it possible to find out the original path that was used to load the assembly in SQL SERVER CLR?
I am very new to working with Assemblies CLR in SQL Server I have a database that has many of them Is it possible to find out the original path that was used to load the assembly ? Considering this …
It is possible to create an Subdatasheet in ODBC?
Basically, I’m trying to manage a stock warehouse, and what I’m curious about is that it is possible to implement subdatasheet inside the linked table? I have found multiple of articles regarding to …
Insert CSV file to already existing table within SQL Server
I have a .csv file that I must update to my already existing table within SQL Server. Is there a query other than a BULK INSERT that I can use for this? Here is the database and table: Backup Database …
Conditionally convert a decimal value to integer
It is showing a result like this But I want result like this when type is 1 then result should be in integer format: on else condition (@Type rather than 1) I want result like this I have tried this query Answer This will work for you. When @type is 1, the result will be 10 for both values. Otherwise
Storing unique images in table
I’ve inherited a database which contains .png images which have been converted byte[] and finally ToBase64String and saved in a table with many duplicate images. I want to clean this up create a new table with unique images but the original tables have no primary key related to the image. I’ve com…
Reverse to STRING_AGG
Here is a sample data on which we are further processing. My question is, is there any exact reverse of the STRING_AGG function for SQL Server? Like I am merging using STRING_AGG with the following code I need to reverse the process but I had to use CURSOR so I am searching for an alternative solution. Below …
Convert 15min to 10min timeseries in SQL Server
I have a timeseries in a 15min format with four different variables. I need to convert this into 10min timeseries format. Due to some constraints, I need to do this in SQL which I agree is probably …