Viewing 15 posts - 9,541 through 9,555 (of 10,143 total)
It won't do any harm to have an identity column in your table, one which isn't populated with data from your spreadsheet but which is automatically assigned a value as...
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
September 22, 2008 at 7:42 am
Here's a little sample data in case this thread is revisited.
[font="Courier New"]SET NOCOUNT ON
DROP TABLE #Entity
CREATE TABLE #Entity (entity_id INT, template_id INT, [name] VARCHAR(20))
INSERT INTO #Entity (entity_id, template_id, [name])
SELECT...
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
September 22, 2008 at 7:13 am
Thanks for the feedback Neil, good luck!
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
September 22, 2008 at 5:48 am
Hi Neil
I reckon this is what you want. Note that there were a couple of missing commas in the SELECT list.
[font="Courier New"]SELECT CL1.CLIENT_UNO, CL1.NAME_UNO, MA1.MATTER_UNO, MA1.CLNT_MATT_CODE, CL1.CLIENT_NAME, NA1.[NAME],
PE2.LOGIN,...
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
September 22, 2008 at 5:21 am
Hi Glen
You will probably find some useful material in the following post:http://www.sqlservercentral.com/Forums/Topic570892-145-1.aspx
Cheers
ChrisM
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
September 22, 2008 at 4:42 am
Hi Ramya
If you set up your formula expression as a string and EXECute it, then any variables defined in the calling batch will be out of scope to the batch...
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
September 22, 2008 at 4:19 am
Hi Ramya
Can't you run the statement as it is? I can't see a need for EXEC:
[font="Courier New"]IF @AssessableValue > 0
SET @BED_BaseAmt = @AssessableValue * @Qty
ELSE
SET @BED_BaseAmt = @price...
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
September 22, 2008 at 3:54 am
Hi Ramya
You are getting this error message because the batch executed by the EXEC statement cannot reference variables declared in the batch from which it was called.
You could use...
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
September 22, 2008 at 3:12 am
Not at all b_boy, it's a learning experience for us all. How about posting up some sample data and results? Everybody would appreciate this.
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
September 19, 2008 at 3:18 pm
'Number' is the Tally table - check the link in Matt's earlier post.
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
September 19, 2008 at 3:14 pm
John
It's a bit of a guess, as Lynn has pointed out, but I reckon this is what you're looking for:
DECLARE @x VARCHAR (5)
SET @x = 'true'
SELECT id1, id2, id3
FROM...
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
September 19, 2008 at 9:32 am
It's too big a step in one go. You need to find out how many rows are returned by each temp table without aggregation, and in particular, how many rows...
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
September 19, 2008 at 9:14 am
ALZDBA (9/19/2008)
I'm used to that :w00t:1) married
2) dba
:D:):P:w00t::hehe:
And if you have children you will lose your voice completely 😛
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
September 19, 2008 at 8:48 am
beruken (9/19/2008)
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
September 19, 2008 at 8:43 am
Not sure you need to do that. First thing I'd do is check the joins. You've got TT_StaffingPlan INNER JOIN TT_Users
but
TT_EntryLog RIGHT OUTER JOIN TT_Users
You need to find out...
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
September 19, 2008 at 8:27 am
Viewing 15 posts - 9,541 through 9,555 (of 10,143 total)