Skip to main content
Filter by
Sorted by
Tagged with
2 votes
2 answers
157 views

Business: I have one manager tied to multiple employees/single employees across different business and Manager and employees are in different rows. We have to map on ID and also on zip codes (both ...
unicorn's user avatar
  • 640
0 votes
1 answer
150 views

Whether in SSMS or in SQLCMD, if I type select power (9.0, 28) I get the wrong result. If I break this down into multiple powers of sixteen, e.g. select power (9.0, 16) * power (9.0,12) I get the ...
user avatar
0 votes
0 answers
69 views

I need to get list of objects depends in each SSIS package using SQL script, or any other approach autoprocess. Example ssis solution have 2 packages. package1.dtsx package2.dtsx Package1.dtsx has 5 ...
Harinanth's user avatar
0 votes
2 answers
127 views

We trigger a stored procedure that inserts into table1, but then we want to remove extra rows, so there are no duplicates. The problem is when we try to remove these dups, it locks the table until it ...
Scott's user avatar
  • 9
0 votes
1 answer
71 views

I'm trying to pull data from a payment table. I need the total Payments received per day. So The column names are "pmttotamt" and [date]. I've tried variations of this statement but am ...
dashley's user avatar
  • 76
2 votes
1 answer
201 views

How does SQL Server handle decimal precision when the SUM() function is called? For precision and scale I have been using this guide to help me determine what is going on. The query goal is to ...
greatFritz's user avatar
0 votes
0 answers
73 views

I used LSRC2 JSON/RPC 2.0 API to connect to LimeSurvey and export the completed Surveys with LimeSurvey version 5.3.32 and C# as a programming language. I used the export_responses API method and ...
Jam Bou's user avatar
1 vote
1 answer
111 views

My powershell script runs fine in powershell command line but throws the following error when run from Sql Agent : Executed as user: DOMAIN\svcSQLDefaultPROD. A job step received an error at line 21 ...
PrettyCode's user avatar
1 vote
1 answer
254 views

I am able to export the stored procedure results as CSV to the local drive on SQL Server, but I am having difficulty exporting the results to an external server (or shared drive location). I am able ...
PrettyCode's user avatar
0 votes
1 answer
178 views

This error seems quite self explanatory but I have no idea how to rectify it. I am trying to copy a group of databases from a SQL Server 2012 instance on one virtual server to a SQL Server 2019 ...
Shaun Gentry's user avatar
0 votes
0 answers
140 views

I have recently noticed that one of the main queries that hits our busiest table fluctuates in terms of actual execution time by quite a lot and I'm struggling to understand why. Below is the table: ...
bn25's user avatar
  • 57
0 votes
1 answer
129 views

I have three tables Table1: Employee Designation Table2: ColumnA ColumnB Ravi Developer Swathi HR Table3: Sourcecolumn Destinationcolumn Employee ColumnA Designation ColumnB Expected Output to be ...
Gowsi's user avatar
  • 7
0 votes
0 answers
83 views

I using SQL Server 2012 and need to use FOR XML PATH to get a comma-separated string for like projects. The query runs and works but when I try to alter #T2, I get an error String or binary data ...
dave82's user avatar
  • 37
0 votes
2 answers
113 views

I am on version 2012 and need to use FOR XML PATH to get a comma separated string for like projects. I have a temp table that I have compiled and would like to combine people based on project numbers....
dave82's user avatar
  • 37
-2 votes
1 answer
141 views

I am getting runtime error while calling a stored procedure (as shown below) in SQL Server 2012 but not in SQL Server 2014, it looks very fundamental, but I would like to know exact reason and if ...
Sagar Shirke's user avatar
0 votes
1 answer
56 views

Given the following query, how do I group by con_num and retrieve the lead_id with the MAX date_entered? I am using SQL Server 2012. SELECT leads.id AS lead_id , leads.date_entered , so....
m-albert's user avatar
  • 1,100
0 votes
2 answers
746 views

When I click a publish button: on the Database project in Visual Studio I cannot access the publish window and I just get a popup that says Object reference not set to an instance of an object. ...
jakub podhaisky's user avatar
0 votes
0 answers
142 views

During the normal use of my program, I received the following error message: "Shared Memory Provider: No process is on the other end of the pipe. **Unable to open a logical session**" After ...
user3162308's user avatar
0 votes
1 answer
131 views

I have written a T-SQL script to count non-blank values in each column across all tables in a database. The script currently uses a cursor to iterate through each column and dynamically generate and ...
Senthil P Nathan's user avatar
0 votes
1 answer
78 views

I'm querying results out of 2 tables, at a time, which has a repetitive pattern. select abc, xyz from 2010_Q1_result inner join 2010_Q1_run (next comes 2010_Q2... inner join ...
suji's user avatar
  • 53
-1 votes
3 answers
94 views

Issue table: col1 col2 col3 col4 ---------------------- 1 null a null 1 b null null 1 null null c 2 aa null null 2 null bb null Output needed col1 col2 ...
Raj's user avatar
  • 1
0 votes
1 answer
84 views

How can I write a CTE in SQL Server to get the date from the preceding row for the person that has Type = NA. If there are multiple preceding rows with NA then take the first one when sorted by dt_eff ...
skv's user avatar
  • 110
-2 votes
1 answer
61 views

I have this data in a SQL Server 2012 table: bill_no datetime 3125 2022-12-26 14:17:21.000 3125 2022-12-26 14:17:21.000 3126 2022-12-26 14:31:48.000 3126 2022-12-26 14:31:48.000 3127 2022-12-26 14:39:...
user 1997's user avatar
0 votes
1 answer
55 views

How to write LEAD function to take value of next record when there is a change in Type. Source Data Person Type dt_eff 123 ABC 2018-10-23 123 DEF 2018-12-19 124 ABC ...
skv's user avatar
  • 110
1 vote
2 answers
98 views

I have a SQL Server table with these 3 columns Id, NetWeight, TransactionWeight I need to update the current row's NetWeight value with the previous row's Netweight + current row's TransactionWeight. ...
sss's user avatar
  • 57
0 votes
2 answers
79 views

Let's say we have value 2006 and now I want to remove 0 from it and the result is 26. Value : 2006 After removing 0, the value is : 26 I have tried to replace directly using replace but in some case ...
Jinesh's user avatar
  • 21
0 votes
2 answers
163 views

First of all I am using this SQL Server version according to @@version: Microsoft SQL Server 2012 (SP4-GDR) (KB4583465) - 11.0.7507.2 (X64) - Nov 1 2020 00:48:37 Standard Edition (64-bit) on ...
DarkMage1972's user avatar
0 votes
1 answer
44 views

My manager wants me count each center that has an order. If a center make one order within the beginning of the last two months, it is considered active for the next two months from the month that it ...
niam dickerson's user avatar
0 votes
1 answer
86 views

I am using SQL Server 2012 and I am trying to "pivot" rows to columns per key. Maximum rows per set is 4. I have prepared a sample code in order to describe it better DECLARE @resu TABLE ...
PanosPlat's user avatar
  • 958
0 votes
1 answer
60 views

This is the sample data: Create table #test (ID int, remark nvarchar(max)) Insert into #test values (1,'ITEM:11119:QTY:24 LABEL:00008402279208913782,ITEM:16400:QTY:90 LABEL:00008402279248620756 ...
Red Devil's user avatar
  • 2,413
0 votes
1 answer
27 views

I need to display prediction graphs using SSRS to make this accessible to some users who need it. To do this, here are the steps successfully completed using VS community 2019: 1- I created a ...
user11665472's user avatar
0 votes
1 answer
54 views

I wanted to display those events which is not having D1. Here is the table schema Create table #tmp (ID int,stopid int,Events nvarchar(10)) Insert into #tmp values (1,1,'AF') Insert into #tmp ...
Red Devil's user avatar
  • 2,413
-3 votes
1 answer
71 views

How do I query this problem? I want to insert a date time in this format in a column name called DateTime_Encoded using a where clause. The format should be this one (mon dd yyyy hh:mi:ss:mmm AM (or ...
user23514345's user avatar
0 votes
1 answer
59 views

I checked a couple of posts which advise a trigger but in my scenario I could not find any trigger. I have a server DB. The client DB has Linked Server setup and points to server DB. Any value change ...
RKh's user avatar
  • 14.2k
2 votes
1 answer
152 views

I have a data set with two columns (Person and Item) and I want to generate a group column (Group) based on column1 but the group will expand to include rows which have the same values as column 2. ...
user23979749's user avatar
-2 votes
1 answer
94 views

I am trying to extract a certain amount of length in string if the specific value is available inside that column. The column however has a lot of data in it which where the value MODEL_NUMBER may be ...
VQB's user avatar
  • 79
-1 votes
3 answers
107 views

Is it possible to have multiple expression in the Then for a Case statement What i want will look like this Select EmployeeId, Case When Dateofjoin > '1-1-2000' Then Select Column1 , Select ...
Matt's user avatar
  • 2,894
0 votes
0 answers
944 views

I recently updated my ASP.NET Core MVC web application from .NET 5 to .NET 8 and have since been having intermittent timeout issues with IIS while running larger queries against the database. The ...
Christine's user avatar
-2 votes
3 answers
157 views

I have a table with around 100,000 articles. Each article has a description. short example: ARTIKELNR DESCRIPTION 104009400031900 S235JRG2C+C EN 10277/10 80 x 8 mm Blanker Flachstahl 104009800002950 ...
ouboma's user avatar
  • 35
-3 votes
1 answer
87 views

In a table organised like this, EventTime Device State UpTime 2024-01-01 04:48:49.080 device_1 1000 1 2024-01-01 04:49:14.097 device_1 1000 0 2024-01-01 04:49:45.753 device_1 1000 1 2024-01-01 04:50:...
Andrea Da Como's user avatar
0 votes
0 answers
88 views

I have this stored procedure that it is not finishing the execution at all. The table TbARIAFLD3_ARIAFLD3Errors has 20 million rows, could you please help me how to execute it faster? The ...
Abdul's user avatar
  • 561
0 votes
1 answer
89 views

I have two tables with Walmart locations, and I want to know which Walmart from one table is closest to the Walmart of the other location. This would be the result, if possible: Source ...
fdkgfosfskjdlsjdlkfsf's user avatar
1 vote
3 answers
135 views

We need to obtain the penultimate row of a table that is sorted by its ID in descending order, not by the date. Then, ensure that the table has unique date values. Finally, once the table is sorted ...
graphene's user avatar
  • 157
0 votes
1 answer
43 views

Using SQL Server, is it possible to create a one row result from two rows? See the following: Sample Data: +-----+-----------+----------------+------------+---------------------+ | PC | DriveName | ...
Caspersky12's user avatar
-1 votes
2 answers
79 views

I have a Python program that executes a series of SQL statements via a loop. It first inserts data in one table, then it inserts data in another table. This table doesn't use an identity seed, but it ...
SkyeBoniwell's user avatar
  • 7,216
0 votes
1 answer
64 views

I am dealing with a library database today. The structure is kind of odd, and I am having trouble pulling the data how I want it to appear. I have this query: SELECT lc.catalogID, hb_g.intro AS '...
SkyeBoniwell's user avatar
  • 7,216
0 votes
3 answers
209 views

I'm trying to populate my database table with some dummy data and I wrote a loop for that. I'm using DBeaver to connect to my SQL Server db and I run the code against it. DECLARE @counter INT = 1; ...
Val's user avatar
  • 1,882
0 votes
4 answers
212 views

I have an entity table that list row per entity, the rows are ordered (using id column) to show an implied hierarchy. Note for row 'B2', 'C1' does not get filled down because that is different second ...
Scott Boston's user avatar
-1 votes
1 answer
1k views

How to get the row number equal when the name is the same in the SELECT statement? When I try with following code: SELECT ROW_NUMBER() OVER (PARTITION BY BENFNAME ORDER BY BENFNAME DESC, BENFNAME ...
Dev's user avatar
  • 1,830
0 votes
1 answer
60 views

I am currently working on a query which needs to update the column posting_ID in transaction table based on the information from Contract table for each client. For example, the transaction table have ...
Aparanjit's user avatar

1
2 3 4 5
341