Viewing 15 posts - 886 through 900 (of 3,489 total)
Can we at least see the stored procedure code? Hard to fix something without seeing it.
September 13, 2019 at 5:30 am
Can't you just use CALCULATE() and IF/SWITCH to handle the different options? CALCULATE lets you override some or all of the current evaluation context. Wouldn't the difference between "early" and...
September 10, 2019 at 4:05 am
What's your expected result? What constitutes a "duplicate"? Two records that cancel each other out, like the last pair do?
September 6, 2019 at 9:45 pm
Oh, if you're trying to restrict groups of users from seeing rows, then use Row Level Security. \
September 6, 2019 at 5:56 pm
use data masking?
https://www.sqlshack.com/using-dynamic-data-masking-in-sql-server-2016-to-protect-sensitive-data/
September 6, 2019 at 9:30 am
Could you explain the context of what you're doing? If you have a table of days and some are marked as holidays, you don't need to store that information in...
September 6, 2019 at 4:11 am
Something like this?
use tempdb;
GO
CREATE TABLE HOLIDAY (DATEHOLIDAY DATE);
CREATE TABLE Times (DATEMONTH DATE, IS_WORK BIT);
GO
INSERT INTO HOLIDAY(DATEHOLIDAY) VALUES('2012-01-01'),('2012-02-01');
INSERT INTO Times(DATEMONTH,IS_WORK) VALUES('2012-01-01',0),('2012-01-02',0),('2012-01-03',1),
('2012-02-01',0),('2012-02-02',0),('2012-02-03',1);
Then the update is pretty simple, because the...
September 5, 2019 at 9:46 pm
If the table already exists, use INSERT INTO instead of SELECT INTO (which creates a new table)
September 5, 2019 at 7:55 pm
Can you set MAXDOP in just that misbehaving query so it runs fast while you sort out what's going on?
September 4, 2019 at 3:46 am
Nobody's going to read an attached (maybe virus-infected) file. Post your CREATE TABLE and INSERT scripts here.
Maybe JOIN() does what you want?
September 3, 2019 at 6:10 am
This is a standard recursive common table expression. Here's an article showing the solution: https://blog.sqlauthority.com/2008/07/28/sql-server-simple-example-of-recursive-cte/
WITH cteEmpH(EmployeeID, ManagerID, usrName, lvl)
AS (
SELECT ID, ManagerID, usrName, 1 AS lvl
FROM Employee
WHERE...
September 2, 2019 at 10:09 pm
Use a common table expression.
https://blog.sqlauthority.com/2008/07/28/sql-server-simple-example-of-recursive-cte/
September 1, 2019 at 8:22 pm
Mockery? Everybody was a noob at one point. I've been fighthing with SQL Server for about 10 years and I still ask silly questions.
No, without the data engine installed on...
August 30, 2019 at 8:41 pm
I would leave the tables separate. You can write a query/function in DAX to do the counts. If they're separate, it makes creating basic measures much easier.
August 30, 2019 at 4:00 pm
LineNo is a reserved word in T-SQL. don't use it as a column name.
August 29, 2019 at 5:51 am
Viewing 15 posts - 886 through 900 (of 3,489 total)