Viewing 15 posts - 4,621 through 4,635 (of 10,143 total)
Your data set is causing heaps of problems here - there are associations where there shouldn't be. I think the query is ok, in fact with properly formed data, you...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 9, 2013 at 4:04 am
ravi@sql (5/9/2013)
select Case when MONTH(GETDATE())=1
then 12
when LEN(MONTH(GETDATE()))=2 then MONTH(GETDATE())
else right('0'+ convert(varchar(2), MONTH(GETDATE())),4) end
In the above query else statment will come it as to come with zero(0)...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 9, 2013 at 3:43 am
sqlnaive (5/9/2013)
ChrisM@Work (5/9/2013)
kapil_kk (5/9/2013)
IgorMi (5/9/2013)
What does its execution plan say? Are there any missing indexes? How big are the tables? Check the statistics on them.
You can replace the IN with...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 9, 2013 at 3:10 am
edalatfeizi (5/9/2013)
no it's just
DECLARE @X INT;
SET @X =12;
What are you using as your client?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 9, 2013 at 3:05 am
edalatfeizi (5/9/2013)
thank you ChrisM@Work.but I have not entered any code between DECLARE and SET my code is:
DECLARE @X INT;SET @X =12;
Not even this?
DECLARE @X INT;
GO
SET @X =12;
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 9, 2013 at 2:05 am
Can you post all of the code between the DECLARE and the SET?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 9, 2013 at 1:59 am
kapil_kk (5/9/2013)
IgorMi (5/9/2013)
What does its execution plan say? Are there any missing indexes? How big are the tables? Check the statistics on them.
You can replace the IN with EXISTS and...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 9, 2013 at 1:55 am
Stefan Krzywicki (5/8/2013)
jasona.work (5/8/2013)
Boon because, especially if it opens, you can get fresh air, bright sunshine...
Curse...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 9, 2013 at 1:28 am
aaron.reese (5/8/2013)
@chrism-2I managed to run that against my entire dataset (some 800K records) and it took less than 30 seconds so a big thanks for that code.
Obiron
That's a result! Thank...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 9, 2013 at 1:16 am
Daniel Bowlin (5/8/2013)
missing
Found, after ten years.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 8, 2013 at 9:11 am
It's going to take far less time and will be far less painful (for me) if I have tables and data to test against. Please can you read the link...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 8, 2013 at 8:54 am
curious_sqldba (5/8/2013)
ChrisM@Work (5/8/2013)
curious_sqldba (5/7/2013)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 8, 2013 at 8:23 am
kapil_kk (5/8/2013)
oopes I am getting error: 🙁...
Can you post it on the relevant thread please?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 8, 2013 at 8:13 am
No worries. Here's another code mod, this one is pretty much complete apart from the error handling block. You MUST read the article and write the code.
--ALTER Procedure [dbo].[BS_Voucher_CreateVoucher]
DECLARE
@vouchertypeID int...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 8, 2013 at 8:04 am
Grant Fritchey (5/8/2013)
I'm nominating ChrisM@Work for saint hood.
Hey! I can be mean!
And, he should be charging for the amount of work he's doing for one company in India. A lot.
I'm...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 8, 2013 at 7:49 am
Viewing 15 posts - 4,621 through 4,635 (of 10,143 total)