Skip to content

Tag: sql

execute powershell from SSMS

I am trying to execute as certain xp_cmdshell code: but this is the error that I get: when I try an execute the same thing in powershell I get the expected response(see image) Powershell The expected output from the xp_cmdshell should be a json Answer The error message implies that your command line is being …

SQL Join with partial string match

I have a table ‘TableA’ like: Another table ‘TableB’ like: I am using INNER JOIN between two tables like: I want to add another condition for join, which looks for value of ‘Group’ in ‘Subgroup’ and only joins if the ‘Group’ Value matches after &#821…

Query monitoring changes in the field

I need to program a query where I can see the changes that certain fields have undergone in a certain date period. Example: From the CAM_CONCEN table bring those records where the ACCOUNT_NUMBER undergoes a modification in the CONCTACT field in a period of 6 months before the date. I would be grateful if you …

How to write SQL query without iterations

I have the following challenge: I have a table called hashtags_users_grouped which has the following structure: In each row, we find values that tell me when a certain user mentioned a certain hashtag and how many times he did it. In this example, user 1 mentioned hashtag 123 one time and 245 three times, whi…

Using Variables in a MSAccess Function with SQL

I’m struggling with entering a custom made ID number on all my tables to link all records together, trying out normalization. I have an EmployeeDetails table and a LoginDetails table. Its my understanding that I need a field called EmployeeID on both and I can use the SQL Select code I have to pull the …