Here's a few of the new posts today on the forums. To see more, visit the forums.
|
SQL Server 2017 - Administration |
Exec SSIS package from TSQL Agent Job Step - Hello, I have a SSIS Package deployed to the SSISDB Catalog. I have a stored procedure setup to create an execution, pass in a few variables/parameters and then start the execution. I created a tsql jobstep to call the stored procedure. This works as long as the agent job is owned by an SA user. […] |
SQL Server 2017 - Development |
BCP to Export Query to Pipe Delimited File - Dear Group: I have a requirement to create a SQL Job that exports a query to a Pipe / Vertical bar delimited file (|) and save it on a network drive in either *.txt or *.csv format. Right now, I am just trying to get this to work inside SSMS, calling the BCP command and […] |
SQL Server 2016 - Administration |
How to upgrade to 2016 AlwaysON from SQL Server 2012 ?. - Hello, I'm looking for the best way to go from existing 2012 Enterprise AlwaysON Cluster to SQL 2016 Enterprise AlwaysON . Existing setup: 2 nodes with OS 2012R2 and SQL Server 2012 Enterprise on latest service pack. Goal for new setup: Purchased 2 new servers that I want to be the final 2 new servers. […] |
SQL Server 2016 - Development and T-SQL |
Query Code returning incorrect results - Hello Community, I have the following logic: Find customers who didn't place orders from 2019-02-01 to 2019-03-01. Output customer's first name. I am working with the following dataset: CREATE TABLE #tmpTable ( id int, first_name varchar(50), last_name varchar(50), city varchar(50), address varchar(50), phone_number varchar(50), id int, cust_id int, order_date date, order_quantity int, order_details varchar(50), order_cost […] |
ORDER BY using successful thousand comma separator - This query requires ActualTotal to be ordered with largest value top however as you can see from the screengrab, this hasn't worked completely. Is there a way to achieve this? Here is my current code: SELECT m.name, FORMAT(x.ComTotal,'N0') AS Total_2020, FORMAT(y.Totals,'N0') AS Some_2020, FORMAT(x.ComToTal + y.Totals,'N0') AS ActualTotal FROM Mees m LEFT JOIN View_2020_Listx_Jan2020 x […] |
Odd query question i did some basic digging but didn't find anything relevant. - SQL Server 2016 cursor and query: select * from table1 where col1 = '1' and col2 = '00001' and col3='I' and col4 = 'JULY--2015' this is a dynamically created query and for the most part the col1, col2 and col3 stay the same only the col4 changes in this test case. while all the other […] |
SQL query for First swipe in and Last Swipe Out for each day for each pay period - Hi, "EMPLOYEE" table has EmpName,EMPID . "SWIPE" table has SwipeTime_UTC,Swipe_location,EmpID . Note:Swipein and swipeout locations are different. SwipeTime_UTC is UTC time format. Looking for SQL query to generate the first swipe in and last swipe out for each employee on each day for given pay period.(Display time should be in EST). Any suggestions pls. Thanks. |
Development - SQL Server 2014 |
Need to insert differences between Staging and Working tables into the Working T - Hi, Still kind of a newbie to SQL Server. Anyway I have two tables: tblStaging and tblWorking. The staging table is updated every 15 minutes and I need to look at what's different in the Staging table and insert the differences into the Working table. I have a combination of two fields that guarantee uniqueness. […] |
SQL 2012 - General |
At wits end with Service Master Key, please help. - Recently our linked servers are failing due to the following "Generic failure...Service Master Key..." So knowing what I know I need to regenerate the Service Master Key using: ALTER SERVICE MASTER KEY FORCE REGENERATE Which I get the following: The current master key cannot be decrypted. The error was ignored because the FORCE option was […] |
How to get duplicate on PartId and Company Id both and have different Status ? - How to get duplicate on Part Id and Company Id both and have different Status ? I work on SQL server 2012 I have issue I can't get duplicate on company id and part id and on same time have different status as partid 1211 and companyid 3030 repeated two times meaning two rows but […] |
There is insufficient system memory in resource pool - Not a DBA here. Now that that is out of the way... I am troubleshooting an issue where our SQL service is stopping. We are on SQL 2012 Express x64 11.0.2100.60 running on Windows Server 2008 R2 Standard x64. The Windows application event logs show: -Event ID 701: There is insufficient system memory in resource […] |
SQL Server 2012 - T-SQL |
Last Column value at the maximum value of Cond Column - Good morning, I'm trying to get the Temp value at the maximum value of the Cond column. The red line in the first query is what I'm expecting, the second one its the result I'm getting at the moment. Current query: SELECT TOP (1) DateTime, CASE WHEN TagName = 'WFI_LP01_Cond.PV' THEN value END […] |
SQL Server 2019 - Development |
CONCAT and CASE WHEN combined - Hi everyone, I'm trying to create a query that concatenates the directions field that were involved in each transaction_id. I've tried to do it by creating a flag table with multiple case whens, and then querying on it, but as you can see in the image below, I'm having trouble to get a multiple 1's […] |
Reporting Services |
Execute Stored Procedure (with no Fields) - Hi Guys, I'm searching for a while now, but can't find a solution. We have a ssrs project where we are using Reports for Dashboarding. To do Right Management, we have a function for each table, these functions has a so called "Token" wich represents a specific user. As these Tokens have a timeout, there […] |
General |
How often have you needed to start a sequence of numbers at other than 1 or 0? - Itzik Ben-Gan (definitely one very smart guy in the world of SQL Server and T-SQL) published an interesting challenge back on the 9th of December, 2020. You can find that challenge at the following link... https://sqlperformance.com/2020/12/t-sql-queries/number-series-challenge To summarize... Itzik posted the basis of his world-famous "GetNums" function, which generates a sequence of numbers. The version […] |