18,329 questions
0 votes
1 answer
260 views
Update query failing for unknown reason
I have a procedure that pushes data from my local SQL Server 2005 database into a table in an Azure DB which is set up as a linked server. The basic data flow is create a #staging table, fill the #...
0 votes
2 answers
154 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
93 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
79 views
How to pass symmetric key to query
I want to know how to pass symmetric key to SQL query as parameter. I'm usually hardcoding it within the query as follows: OPEN SYMMETRIC KEY SymKey DECRYPTION BY CERTIFICATE CertiFi; SELECT * FROM ...
0 votes
0 answers
54 views
Possible reasons for an SSIS conditional split into the same destination table?
I've been given the unenviable task documenting the catalogue ingest process of our data warehouse. All was going well until the end where I came across the use of a conditional split inside of an ...
0 votes
1 answer
104 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_ ...
0 votes
0 answers
263 views
What does the value 30 indicate in the type column in the MSrepl_commands table?
Result Set of MSrepl_commands I want to infer that whether its a insert/update/delete command . We need to check at day end the amount of data replicated per article by the transactional replication. ...
-1 votes
1 answer
141 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 ...
0 votes
1 answer
97 views
Auto applied migrations using EF Core 7.0.14
When I make a new migration (Add-Migration Example) , and then I try to get all the migrations (Get-Migration) I find that the "applied" field is "True" without even using (Update-...
1 vote
4 answers
118 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 Matched 30 Matched 30 Not ...
-1 votes
3 answers
328 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
0 answers
149 views
Write error with spark.write against SQL Server table (via JDBC Connection)
We are trying to save a DataFrame in SQL Server (V2005) using the following method: df_cards.write.jdbc(url=conn_str, table=tablename, mode='append', properties=properties) However, we encountered ...
0 votes
1 answer
156 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
113 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
1k 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, ...