Viewing 15 posts - 211 through 225 (of 1,923 total)
Rory, how big are the 2 tables?
April 19, 2012 at 11:19 am
May i add another method?
SELECT DISTINCT OBJECT_NAME (SC.id)
FROM syscomments sc
WHERE sc.text LIKE '%DatabaseA%'
April 19, 2012 at 11:11 am
drew.allen (4/16/2012)
SELECT u.SourceA, u.SourceB, t.Counts
FROM #Temp1 AS t
CROSS APPLY(
SELECT SourceA, SourceB
UNION
SELECT SourceB, SourceA
)...
April 16, 2012 at 1:38 pm
Somehting like this?
SELECT SourceA = ISNULL(TabA.SourceA , TabB.SourceA)
,SourceB = ISNULL(TabA.SourceB,TabB.SourceB)
,Counts = ISNULL (TabA.Counts ,...
April 16, 2012 at 1:06 pm
How do you arrive at the order of the results? what are teh rules for it?
April 16, 2012 at 12:56 pm
Matt Miller (#4) (4/16/2012)
Learner1 (4/16/2012)
@cold coffee...Thanks a lot ...it works ............
Just be careful with this. You will have to ensure that SSIS actually assigns the ID's in the correct...
April 16, 2012 at 10:46 am
hxkresl (4/16/2012)
I can't believe it ColdCoffee. I thank you....I want to work where you work 🙂T-SQL is amazing.
Lol, they dont even want me at the office :-D:w00t: (that was...
April 16, 2012 at 10:13 am
masonvann (4/16/2012)
That is incredibly helpful! Thank you so much for the time and energy you put into the explanation. I know I'll be visiting this more than once!
Thanks for the...
April 16, 2012 at 10:12 am
I had some spare time now and here is the query
First, sample data
DECLARE @Tab TABLE
(
iD INT IDENTITY(1,1)
,Data VARCHAR(100)
)
INSERT @Tab
...
April 16, 2012 at 10:07 am
With 314 points and 791 visits, i hope you know the etiquettes in posting the sample data in readily consumable format. Please follow Jeff's article http://www.sqlservercentral.com/articles/Best+Practices/61537/ and post your data.
FYI,...
April 16, 2012 at 9:51 am
If the input values are either NULL or some value, the we can use this as well.
IF @ID IS NULL
BEGIN
-- We know we need everything...
April 16, 2012 at 9:45 am
Try this:
SELECT *
FROM @TABLE T
WHERE ISNULL(T.fldID, '') = CASE WHEN @ID IS NULL THEN ISNULL(T.fldID, '') ELSE @ID END
April 16, 2012 at 1:50 am
How about this?
Setting up the sample data
DECLARE @Tab TABLE
(
ID INT
,Tym TIME
,Axn INT
)
INSERT @Tab
SELECT 1 ,'10:00', 1
UNION...
April 16, 2012 at 1:40 am
Your sample data has a flaw; All the iDs after 9 are 8 only. You have to increment them. I did that, and here is the query that produces the...
April 16, 2012 at 1:14 am
So, you can ask you question like this!
Hi here are is my sample data and sample table structure
IF OBJECT_ID('tempdb..#Temp') IS NOT NULL
DROP TABLE #Temp
-- Sample Table
CREATE TABLE...
April 16, 2012 at 12:11 am
Viewing 15 posts - 211 through 225 (of 1,923 total)