Viewing 15 posts - 1,081 through 1,095 (of 3,480 total)
like this?CREATE TABLE [dbo].[ProductCodes](
[F_Product] [char](1) NOT NULL,
[F_TextCode] [char](7) NOT NULL,
[F_Phrase] [varchar](5) NOT NULL
);
GO
INSERT INTO ProductCodes VALUES
('A','MANU001','TEST1'),
('A','MANU002','TEST2'), ...
January 24, 2019 at 12:01 am
no. my requirement was super simple. Essentially, when an employee is assigned a task/drug protocol/whatever, send him an e-mail advising him of it. I had asked about this maybe pre-Service...
January 22, 2019 at 7:28 pm
Maybe they're waiting for you to post your plan for them to comment on?
January 21, 2019 at 10:01 pm
Oh, okay. That's what I was wondering. Thanks for the explanation. I was reading the documentation and it wasn't totally clear.
Thanks, Lowell (and everybody). That answers my question.
January 21, 2019 at 5:28 pm
There query appears to be missing an alias:SELECT o2a.SOURCE_ID source_id, o2a.VALUE
FROM CR2Copy..OBJECT_TO_ATTRIBUTE
should beSELECT o2a.SOURCE_ID source_id, o2a.VALUE
FROM CR2Copy..OBJECT_TO_ATTRIBUTE AS o2a
January 21, 2019 at 8:42 am
How about some data? CREATE TABLE and INSERT scripts?
Why not do the CASE statement in an inner query, and then pivot that result?
January 18, 2019 at 9:30 pm
DISTINCT is going to be brutal slow.
AND o2a.STATUS_ID = 33000000000001 AND o2a.PROPERTY_ID = 1000000060338
AND o2a.SOURCE_ID
and then are those columns indexed? (maybe included in PK index?)
January 18, 2019 at 7:09 pm
Wait, if you want a cumulative sum, your formula is wrong. There's no ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW in there... Is there are hierarchy in this? Can you...
January 17, 2019 at 8:50 pm
January 17, 2019 at 6:22 pm
Go back and ask said DBA why he wants this. Sounds absurd. The nice thing about stored procedures is that you can assign rights to them. you can't do that...
January 17, 2019 at 1:43 pm
If you have a Calendar table, this is infinitely easier. You would outer join Calendar to your Trips table and then aggregate on columns in the Calendar table (Year, Month,...
January 15, 2019 at 3:20 pm
You need to calculate the month from the date. A date is just a number...
SELECT MONTH(start_date), COUNT(*) AS Count
FROM trips
WHERE YEAR(start_date) = 2016
GROUP BY MONTH(start_date);
January 15, 2019 at 11:41 am
.What if you automated Excel to write the values somewhere? Assign the values to variables (one for the file name too), and then maybe have a connection to your database...
January 14, 2019 at 8:26 pm
If you add a Calendar table and put the FM, FY in there as columns, then this is trivial.
January 14, 2019 at 2:43 pm
Viewing 15 posts - 1,081 through 1,095 (of 3,480 total)