Viewing 15 posts - 2,176 through 2,190 (of 2,894 total)
Absolutely! It was cut-&-paste issue. Didn't put the second one after unconditional set noexec off.
if (OBJECT_ID('p_a') is null) SET NOEXEC OFF;
GO
if (OBJECT_ID('p_a') is not null) SET NOEXEC ON;
GO
create proc...
February 14, 2012 at 1:13 pm
Please try to post your question in accordance with forum etiquette, you can find the link at the bottom of my signature.
You can use following query to get the list...
February 14, 2012 at 10:12 am
Phil Parkin (2/14/2012)
That's ugly, but also taught me something, thanks! 🙂
Ugly is a very subjective view.
In my opinion it's quite extravagant 🙂
It's usefull when you want to stop batch script...
February 14, 2012 at 10:02 am
You need to be a bit more creative with your T-SQL batch to achieve what you want :-D:
if (OBJECT_ID('p_a') is null) SET NOEXEC OFF;
GO
if (OBJECT_ID('p_a') is not null) SET...
February 14, 2012 at 9:48 am
Ok, your "results start coming instantly" means nothing, as most likely they will take even longer to come out in full than SELECT INTO. 1.8 millions should not take 2.30...
February 10, 2012 at 6:08 am
I would try to SELECT INTO #table the result of the query including the calculated columns used for grouping (without grouping itself), then the final query would select from #table...
February 10, 2012 at 3:06 am
It was just a guess which worked, however it could be down to the code inside of proc. It is always good to post code when asking performance question!
Also, playing...
February 9, 2012 at 10:23 am
Post your proc code!
Try:
SET ANSI_NULLS ON
GO
Before creating your proc.
February 9, 2012 at 10:09 am
xRafo (2/9/2012)
if the temporary table is in dynamic sql?
So what? You can use temp # tables in dynamic sql.
What is you point?
February 9, 2012 at 9:55 am
You can optimise the solution even further. Few tips:
1. Create Error table on fly using SELECT INTO and UNION ALL
2. You may find that before loading data to the final...
February 9, 2012 at 8:13 am
J Livingston SQL (2/9/2012)
I believe the COUNT(*) needs to be COUNT(DISTINCT VendorName) to allow a single vendor to have more than one presence in the city.
absolutely agree...but should it be...
February 9, 2012 at 8:02 am
Could you please provide the full query at least, please. Grouping is relatively expensive operation as well as string concatination. It's impossible to advise on optimisation without having underlying object...
February 9, 2012 at 8:00 am
If you want to do it in the hand crafted T-SQL, you can do the following:
Import all data into the staging table with reasonbaly maximum unrestricted varchar datatype for ...
February 9, 2012 at 7:48 am
Jeff, that why I said "one of". I was afraid to recommend using "HAVING COUNT..." as it could be even harder to explain to his "instructor".
However, if...
February 9, 2012 at 7:36 am
Ask your "instructor" what will happen if two different states have the city with the same name?
The solution given to you is not only wrong, but also would perform badly...
February 9, 2012 at 7:06 am
Viewing 15 posts - 2,176 through 2,190 (of 2,894 total)