All Questions
Tagged with sql-server-2005 sql
8,016
questions
0
votes
2
answers
100
views
Extract and process substring between varying numbers of delimiters in a variable length string
I have a table dates with a column SENTDATE where each row has a varying number of dates in it, separated by a semi colon (;). The dates are currently in the format YYYYMMDD - for example:
20240529;...
1
vote
1
answer
59
views
How to dynamically set the value of a parameter in sp_executesql without modifying the calling software
I'm currently working with a stored procedure that executes an INSERT statement using EXEC sp_executesql. The procedure takes several parameters, including @TRANSACTIONNUM, @CUSTOMERNUM, @VALUE, and @...
0
votes
1
answer
85
views
Replace occurrences of characters in a string
Values in the column Name_Orig look something like this:
**Ang-Stl-A36-6X4X.5**Angle,A36*,4X6X1/2****
I want
First occurrence of ** to be replaced by Xx_
Second occurrence of ** to be replaced by a_
...
-1
votes
1
answer
115
views
What is the fastest way to extract data from SQL Server 2005 using PowerShell 7?
This is not just a simple extraction.
I have two tables. I take the values from one table and then use one column from this table to find a corresponding value in another table and then extract all ...
1
vote
4
answers
94
views
Need a SQL Query for Getting matched and not matched Records
My table structures are shown here:
Table1
Col1
10
20
20
20
30
30
40
Table2
Col1
10
20
30
40
My expected result is this:
Col1
Col2
10
Matched
20
Matched
20
Not Matched
20
Not ...
-1
votes
3
answers
130
views
SQL Server query returns multiple line results instead of returning 1 line
Using SQL Server, I have multiple tables:
Assignments
aID,
acID,
clientID,
userID,
pos,
dateOn
AssignmentCarriers
acID,
clientID,
cName,
isAssignment
Users
userID,
fName
Clients
...
0
votes
1
answer
120
views
Extract data using multiple conditions for the column value?
From a certain column I need the following type of data:
Value is 6 characters long and is numerical
“L” is any letter followed by 5 numerical characters, for example L12345 the L needs to be turned ...
1
vote
0
answers
77
views
MS SQL SERVER 2005 temp db log file size is increasing
Sometimes, when there is no load on the server, the size of the MS SQL database tempdb log file (templog.ldf) starts increasing. As a result, the available space on the C drive decreases. To resolve ...
1
vote
3
answers
738
views
How to get the sum of a column for the current month?
I have a column Amount which I want to get its sum by month within each year.
I have tried the following query and it works well for year but month is summing up incorrectly. For instance in this May, ...
0
votes
1
answer
48
views
SQL Server 2000 database after restore to 2005 is empty
I have very old backup file (.bak) of SQL Server 2000. After restoring it to SQL Server 2005, the database looks empty (please see screenshot).
What is the probable cause?
screenshot
0
votes
1
answer
30
views
I want order details also like order columns
select o.*,x.cust_name from(
select cust_name from customer c where salesman_id IN(
select salesman_id from Orders o where ord_date ='2012-08-17'))x
I only got customer names but i need order ...
-2
votes
1
answer
42
views
By using single CTE with multiple statements in it. can I perform mathematical operations on CTE output to get final output?
Below is my CTE Example It's just a example my actual query is different
;with CTE as
( select 1+1 as A,2+2 as B,3+3 as C
)
select (A+B)-C as Final_Count from CTE
here in above example A,B & C ...
-1
votes
2
answers
55
views
Need to rank the data in SQL Server
From the input data, I need to rank the id. The data is order by time ascending.
Example: id number 421492036 has two record with code '05' and is ordered by time ascending.
The ID 421492036 has same ...
0
votes
1
answer
888
views
How to resolve "...Error occurred during the execution of xp_cmdshell"?
The engineers uses this Access based app that takes data from SQL Server 2005.
The users download a file containing details of parts etc make amendments and upload it again. When the file is upload(...
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 ...