Viewing 15 posts - 1,006 through 1,020 (of 7,187 total)
Let's start by removing the spurious first CTE from your code:WITH rpt_emp as
(SELECT e.EMPLOYEE_NUMBER, e.CLIENT_NUMBER emp_cl_number, -->Part 1 for employees
COUNT(e.CLIENT_NUMBER) OVER() emp_cl, --> Part...
December 22, 2017 at 3:26 am
SELECT v.Address, c.City
FROM Vendors v
LEFT JOIN Cities c ON v.Address = '%' + c.City + '%'
Edit:- added c.City to SELECT list.
John
December 21, 2017 at 8:41 am
December 20, 2017 at 9:57 am
Yes. The UNION operator eliminates duplicates and hence needs to perform a sort operation. If you know there are no duplicates (which I think there aren't, in this case) you...
December 20, 2017 at 9:31 am
If you want to update 10,000 rows at a time, you can use an UPDATE TOP (10000) ... ORDER BY ID statement in your loop. You'll probably need an OUTPUT...
December 20, 2017 at 7:35 am
Use a string splitter to split each date into its individual elements, and keep those that have four characters and can be converted to a number between, say,...
December 20, 2017 at 4:04 am
Have you checked what that error message means? Sounds like some kind of network issue to me, but don't take my word for that.
John
December 20, 2017 at 3:55 am
December 20, 2017 at 2:22 am
I would advise you not to grant access to public. That means that anyone who can get on the server can run the stored procedure. Grant access only to the...
December 19, 2017 at 4:15 am
Then it's your SQL Server Agent service account that needs to have permission to run the stored procedure.
John
December 19, 2017 at 2:58 am
GA_SQL - Monday, December 18, 2017 10:03 AMThe EXECUTE permission was denied on the object 'sp_send_dbmail'
And do you get that error whether...
December 19, 2017 at 1:12 am
GA_SQL - Monday, December 18, 2017 9:28 AMyes sir, email sent in the case SP executed directly
So is this resolved? Because if...
December 18, 2017 at 9:34 am
GA_SQL - Monday, December 18, 2017 9:15 AMThe EXECUTE permission was denied on the object 'sp_send_dbmail' [SQLSTATE 42000] (Error 229).
That's strange. You...
December 18, 2017 at 9:23 am
December 18, 2017 at 5:48 am
All you've told us is that you have a job that sends an e-mail saying that a backup succeeded. Does the job actually do the backup as well? Please post...
December 18, 2017 at 5:21 am
Viewing 15 posts - 1,006 through 1,020 (of 7,187 total)