Skip to main content

Questions tagged [sql-server-2005]

Use this tag for questions specific to the 2005 version of Microsoft's SQL Server.

0 votes
1 answer
302 views

SQL output error when try to find duplicate value in a table

select count([Item Nbr]) as [Item Nbr], count([Item Flags]) as [Item Flags], count(UPC) as UPC, count([Store Nbr]) as [Store Nbr] , count (RetrievalWeek) as RetrievalWeek, * from ...
pika's user avatar
  • 1
0 votes
0 answers
342 views

Linked servers, results query xp_cmdshell to table migration SQL Server 2005 to SQL Server 2019

I'm migrating procedures from Microsoft SQL Server 2005 to Microsoft SQL Server 2019 and I got stuck while trying insert query result xp_cmdshell in linked servers to table I'm out of ideas Old ...
wielebny's user avatar
-1 votes
2 answers
11k views

Subtract hours from current date time and compare to column value whose data type is datetime

I want all the MAFN column values that were added to the table in the last hour(:mm). The column ReturnDt stores the time it was added in DateTime format ex.'2005-01-11 08:50:24.767' I can get the ...
Brute 's user avatar
  • 131
1 vote
1 answer
141 views

Get the history values based on Revision Id

I have a two table table, first table storing all the latest data and second table to capture the changed data. For example if an user change value the FIRST table will update the data and SECOND ...
David Lee's user avatar
0 votes
2 answers
188 views

How to retrieve data from SQL Server 2005 on Windows Server 2008 R2 on static IP, in a secured manner to Power BI? [closed]

Situation My company software is running on SQL Server 2005 on Windows Server 2008 R2 with a static IP. Requirement I wanted to access data for reporting into Power BI. What I have tried so far ...
amitdigga's user avatar
  • 6,938
1 vote
0 answers
143 views

Prevent rspec from running migrations

I have a rails app with a sql server database. I manually create an empty database for rspec to test on with all the necessary tables before running the specs. Currently when running the specs the ...
marrnj2's user avatar
  • 11
4 votes
1 answer
477 views

Multi step table value function faster than inline table value function

I know, I know. It's not supposed to be this way. Big picture, I'm working with map data and trying to determine which street a bus stop is closest to. A street is made up of a series of points. Some ...
George Mastros's user avatar
0 votes
2 answers
137 views

Calculate Running Total Summary based on Different column

I need output like below StockQty = 10 Balance Qty [Allocate Stock Qty] Shortage [Stock] Running Stock 5.000 5.000 0.000 5.000 10.000 5.000 5.000 0.000 5.000 0.000 5.000 0.000 10.000 0.000 10.000 ...
Zoyeb Shaikh's user avatar
-1 votes
1 answer
67 views

Find Running Total In sql - if 1st column has no value then calculate from 2nd column

declare @tbl as table ( ItemId int, SOQty int, DIQty int , IssueQty int, BalanceQty int, CreateDate datetime, StockQty int, WIPQty int ) insert into @tbl values (1,10,...
Zoyeb Shaikh's user avatar
0 votes
1 answer
38 views

combining Rows in SQL which are in the same column

I am trying to combine two columns into two rows. I am unbale to work it out with the PIVOT table. My table looks like this name | status | timestamp 212 50 t1 213 50 t2 212 ...
Engineers Kitchen's user avatar
1 vote
0 answers
76 views

Not able to fetch User who is having Permission as part of CERTIFICATE as Securable in SQL Server

Purpose of the query is to fetch all permissions for Particular user with all the details. Please find my query below : SELECT 'permUser1@master' AS dbUserName, dp.NAME ...
Suraj Kudale's user avatar
1 vote
1 answer
176 views

Select Min() and other columns and GroupBy by two columns in EF 6

Using the example below, (from the answer in this link here) how can I select/group with an extra column ? I have searched this site and others and tried some examples but couldn't get it to work. // ...
Ben Junior's user avatar
  • 2,521
0 votes
1 answer
354 views

Flask SQL Alchemy try perform SET operation, when it is not needed

I am facing a very strange issue using SQL Alchemy. I have a table in SQL server, to store Sales, with this format : CREATE TABLE Resale ( [address] VARCHAR(100) NOT NULL, [id] BIGINT NOT NULL, [...
kilag's user avatar
  • 546
1 vote
3 answers
1k views

SQL Query to determine number of tables

I have this table and I'm trying to determine how many Tables (in a restaurant) are awaiting food. The table( in the database) has the following columns: TableNumber, ObjectType, ObjectDescription and ...
OldJan's user avatar
  • 13
0 votes
0 answers
36 views

Remove Duplicate Rows in SQL 2005 with primary key identity seed and Date Time Stamps

Columns: ID (int) , Part (varchar), DF0 (varchar), DF1(varchar), DF2(varchar), DF3(varchar), DTI(DateTime) All the samples I seem to find can get me the count or the data minus the ID and DTI. I need ...
BillyDvd's user avatar
  • 176

15 30 50 per page