Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question This is my trigger and its running perfectly with the help of stackoverflow.com I edit my ques…
Tag: sql-server
Divide by zero error encountered error. Null value is eliminated by an aggregate or other SET operation
In this specific part of a SP I’m trying to create, I’m getting an error: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Divide by zero error encountered. Additional error <2>: ErrorMsg: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Warning: Null value is eliminated by an aggr…
Combining Values in a Column by Date
I have been tasked with writing this simple query and am not sure where to go from here. I am trying to create a report that shows 3 columns: Date_Column, Id_Column, & Amount_Col. The table for Id_Column has different IDs based on a location column (in the table, but not in my query below). For the report…
How to get around this error related to a CASE statement in my ORDER BY syntax?
I am using SQL Server 2014 and I am querying a linked server. My T-SQL query stands as follows: My issue is that I am getting the following error message when running the above T_SQL query: How can I get around this error? Answer I don’t know where the nested case expressions are coming from. But an alt…
How to eliminate this SQL String_Split function error
Trying to use the SQL string_split function in a dynamic query but I continue to receive the following error. Invalid column name ‘Invoice Description’. Argument data type void type is invalid for argument 1 of string_split function. I can not figure out the issue. Any help is greatly appreciated.…
SELECT INTO vs WITH AS: Who is faster in the temp table approach?
I have a little experience with these two structures. Is there a performance improvement using one or another to use temp tables? I know that SELECT INTO creates a table that persists after the query and is removed after some time. There is some problems when using the same query after a few seconds (SQL Erro…
How to combine multiple rows (one column) into One row
I am using SQL server 2017 and I have a scenario where I want to combine multiple rows of data into one row. Please see the below screenshot and let me know if that is possible. Thank you. Apologies if anything is missing. Please let me know the query on how to achieve this Answer SQL Server has supported str…
Remove duplicate rows from a big table
I’ve got data from third party and imported to SQL server. The table has 255,072,636 records and 61,714,772 are unique among these records. The table has neither specific order nor any index. The table has 4 columns: Field1(float), Field2(varchar(255), Field3(varchar(255), Field4(varchar(255). I want to…
Unexpected results with consecutive + and – [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question I have the following queries : The result is : How is this output explained…
Call tabled function with parameters in sql
I’m a newbie in SQL and with programming languages in general. I’m trying to make a tabled function in SQL (SQL Server): and then I have to call it in another sql page. I’ve tried to use this syntax: If I run my SELECT I don’t have any result, because my parameters are not initialized.…