Viewing 15 posts - 4,981 through 4,995 (of 7,610 total)
You can use CONTEXT_INFO to pass the name of the proc to the trigger. The calling proc sets specific bytes in CONTEXT_INFO, and the trigger substrings out those bytes...
July 10, 2015 at 11:01 am
Sure, I'll try to explain as best I can.
Each subquery (they're not technically CTEs but subqueries) reads one of the separate tables to be joined, and assigns a sequential row#...
July 8, 2015 at 4:23 pm
Maybe something along these lines?:
SELECT
COALESCE(ern.EmployeeID, tax.EmployeeID, ded.EmployeeID, ben.EmployeeID) AS EmployeeID,
MAX(ern.PayCode) AS EarningPayCode,
MAX(ern.Units) AS EarningUnits,
MAX(ern.Rate)...
July 8, 2015 at 1:49 pm
Not directly, at least not easily.
But you could put each in a separate job and start the three jobs -- the sp_start_job command runs and returns immediately, without waiting for...
July 7, 2015 at 4:30 pm
Create a Policy lookup table to assign the common policy id and the sort order:
CREATE TABLE Reporting_PolicyGrouping (
Policy_Name varchar(50) NOT NULL,
Policy varchar(50)...
July 7, 2015 at 1:28 pm
WHERE (INSERT_DETECT_TS between '20150602' and '20150603')
You cannot safely use between. You need to use the >= and < (not <=, as in between) that I used earlier:
WHERE (INSERT_DETECT_TS >=...
July 7, 2015 at 12:33 pm
I don't think SQL is using async processing for that specific cursor, based on this information from Books Online:
"
SQL Server does not support generating keyset-driven or static Transact-SQL cursors asynchronously....
July 7, 2015 at 12:24 pm
drew.allen (7/6/2015)
order by ABS (DateAdd(Minute, 30 * (DateDiff(Minute, 0, closedate) / 30), 0)) ASC
DATEADD() returns a date/time and ABS() takes a...
July 7, 2015 at 9:53 am
select c.APPLICANT_ID as [Applicant ID], aetc.EVENT_TYPE as [Event Type],
cast(aetr.CREATE_DATE as date) as [Registration Date],
cast(aetc.CREATE_DATE as date) as [C Creation Date],
right('0' + cast(minutes_diff / 1440 as varchar(2)), 2)...
July 7, 2015 at 9:50 am
Edit: changed these comments:
Most important is to change the WHERE to not use functions on the table column.
You should also very strongly analyze clustering the table by INSERT_DETECT_TS (add Incident_Id...
July 7, 2015 at 9:36 am
Here's a completely setting-independent way to calc only Fridays; it's actually a straight-forward task. Note: Since my software at work blocks CTEs (as some type of "injection"), I had...
July 6, 2015 at 5:54 pm
There's no really good way to do that because it's so difficult. A db could be referenced by a linked server or by a 3-part name contained in dynamic...
July 6, 2015 at 5:16 pm
Yeah, you could do that, but it's rather bizarre. What would the day before's activities have to do with today?
July 2, 2015 at 11:15 am
Again, check this DMV:
sys.sql_expression_dependencies
July 1, 2015 at 3:49 pm
A table that doesn't exist is a different issue, because SQL's deferred name resolution allows that, but not invalid/missing column names.
The other thing to try would be dmv:
sys.sql_expression_dependencies
July 1, 2015 at 3:31 pm
Viewing 15 posts - 4,981 through 4,995 (of 7,610 total)