Viewing 15 posts - 886 through 900 (of 3,480 total)
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
This looks like it works...
CREATE TABLE #Test(
col1 int,
col2 int,
col3 int);
GO
INSERT INTO #Test VALUES
(1, 203, 1232)
,(2, null, 2343)
,(3, 502, 15566)
,(4, null, 4566)
,(5, null, 4545)
,(6, 601, 4545)
,(7, 601,...
August 28, 2019 at 11:08 pm
Job security.
Can't you just right-click on the table and ...Script Table As... Insert/Update/Delete?
August 26, 2019 at 8:19 pm
have you looked at windowing functions? RANK()? DENSE_RANK()?
August 25, 2019 at 10:21 pm
So you just slap a CREATE VIEW on the front and list the columns you want to return. Only catch is that you can't use ORDER BY in a view.
August 25, 2019 at 7:51 pm
This appears to work... but my eyesight is terrible, so test it:
SELECT Party
, EIDs = STUFF((
...
August 22, 2019 at 1:35 pm
If you're doing this in PowerBI, don't you want a measure that calculates a count, like COUNTROWS('FactTable') and then use CALCULATE() to modify the evaluation context?
Here's an example of doing...
August 13, 2019 at 2:01 am
Okay, this one really works... Maybe my brain is taking the weekend off...
First things first, we need some data (CREATE TABLE and INSERT scripts)
use tempdb;
GO
CREATE TABLE #Sales...
August 11, 2019 at 10:18 pm
Viewing 15 posts - 886 through 900 (of 3,480 total)