Viewing 15 posts - 511 through 525 (of 627 total)
I don't often post these kinds of links but it was so good I just had to share.
For anybody who has ever written code...
http://fundd.blogspot.ca/2012/02/public-object-dostuff-return-new-object.html
Cheers,
July 2, 2015 at 11:27 am
To illustrate Gila's point I used AdventureWorks to demonstrate how a temp table could work.
BAD
DECLARE @query_from NVARCHAR(MAX) = ''
DECLARE @query NVARCHAR(MAX)
DECLARE @TableVariable TABLE (ID INT)
INSERT INTO @TableVariable VALUES (1),(2)
SET @query_from...
July 2, 2015 at 9:19 am
GilaMonster (7/2/2015)
yb751 (7/2/2015)
SET @query_from = @query_from + CHAR(10) + ' JOIN ' + @TableVariable + ' on ABC.ID = ' + @TableVariable + '.ID...
July 2, 2015 at 8:41 am
It becomes much simpler to visualize what you are doing wrong when you output your string.
DECLARE @TableVariable NVARCHAR(50) = 'MyTable'
DECLARE @query_from NVARCHAR(MAX) = ''
---You are doing this
SET @query_from = @query_from...
July 2, 2015 at 8:29 am
SQLBill (6/26/2015)
June 26, 2015 at 1:56 pm
TCcool (6/26/2015)
June 26, 2015 at 1:37 pm
TCcool (6/26/2015)
June 26, 2015 at 11:59 am
Here's what I came up with. You'll have to populate a table with your search patterns.
DECLARE @people TABLE (Logid INT IDENTITY(1,1), SourceData NVARCHAR(50), Account NVARCHAR(50))
DECLARE @check TABLE (Pattern NVARCHAR(10))
INSERT...
June 26, 2015 at 11:50 am
Since your using 2005...
DECLARE @people TABLE (Logid INT IDENTITY(1,1), SourceData NVARCHAR(50), Account NVARCHAR(50))
INSERT INTO @people (SourceData, Account)
SELECT '123X-456','56789' UNION ALL
SELECT '456/123','A345' UNION ALL
SELECT 'ABC 345','X567' UNION ALL
SELECT '456 HELP-123','YCHB' UNION...
June 26, 2015 at 11:35 am
SQLBill (6/25/2015)
Brandie Tarvin (6/25/2015)
Why did you hate his books (aside from him killing off favorite characters)?
Was it...
June 25, 2015 at 2:21 pm
Kutang Pan (6/25/2015)
My Solution:
SELECT A.ID,COUNT(B.SomeColumn) AS [CountOfB]
FROM @T1 A
LEFT JOIN @T2 B ON B.SomeColumn = A.ID
LEFT JOIN @T2 B2 ON B2.AnotherC = A.ID
GROUP BY A.ID
That should perform better and...
June 25, 2015 at 12:40 pm
CraigIW (6/25/2015)
The originally suggested solution appears to...
June 25, 2015 at 11:32 am
EDIT: Sorry I just wasn't happy with my original solution.
June 25, 2015 at 8:24 am
lskidgel (6/24/2015)
June 24, 2015 at 11:33 am
I don't know what you are using as your dataset but you could just have two sources.
I'm just using pseudo code here but something like...
SELECT TOP 5 Question, Answer FROM...
June 24, 2015 at 7:36 am
Viewing 15 posts - 511 through 525 (of 627 total)