Viewing 15 posts - 976 through 990 (of 1,229 total)
You don't need a cursor.
Run this and check that the output represents the rows you want to delete:
SELECT pmt.*, '#', pt.*, '#', p.*
FROM posriskmatrix_testing pmt
INNER JOIN pos_testing pt
ON pt.idinst...
April 13, 2011 at 1:32 am
WayneS (4/7/2011)
mohammed moinudheen (4/7/2011)
It is very tough to get this question right:)
Actually, I meant it to be tough. The other choices are all myths that a lot of people...
April 12, 2011 at 9:57 am
ichiyo85 (4/11/2011)
Yes I will not have both ID1 and ID2 to be null. Also, ISNULL might not be a good idea for me because ID1...
April 12, 2011 at 2:59 am
ichiyo85 (4/11/2011)
I have 2 tables where I want to join by ID1, IF NOT THEN join by ID2.
Would this code work?
select * from table1
left join table2
on coalesce(table1.ID1,table1.ID2) = coalesce(table2.ID1,table2.ID2)
I...
April 12, 2011 at 2:57 am
nailers (4/11/2011)
I have two tables named: LiveRun and Run
The LiveRun table has...
April 11, 2011 at 11:49 pm
Pink123 (4/11/2011)
It sjust
insert into #temptable
select ....
from ...
then I do a select rownumber as mentioned in my query and it gives rowcount as...
April 11, 2011 at 3:08 pm
Pink123 (4/11/2011)
How do I get the actual...
April 11, 2011 at 10:20 am
There may be some mileage in preprocessing table b (as a derived table) before joining to table a:
SELECT a.DealNumber, b.DealStatus, a.StepNum
FROM a
LEFT JOIN (
SELECT DealNumber, DealStatus, StepNum,
IDInGroup = ROW_NUMBER()...
March 17, 2011 at 8:29 am
adonetok (12/15/2010)
For example, one table is as below. There are 100 columns. (I only list 10 columns)
Each cell...
December 15, 2010 at 12:40 pm
Tom.Thomson (12/12/2010)
Steve Jones - SSC Editor (12/11/2010)
Tom.Thomson (12/11/2010)
Celko's been at it again, and Gus's response http://www.sqlservercentral.com/Forums/FindPost1032150.aspx is unfair to monkeys.Excellent response from Lowell and Gus.
Tom, new avatar?
Yes, it changes now...
December 12, 2010 at 8:15 am
Can you post the whole view definition, Chrissy?
December 12, 2010 at 8:12 am
Specifying an expression rather than a value for the parameter default. Try this instead:
ALTER FUNCTION myTbl
(@theDate smalldatetime = NULL)
RETURNS TABLE
AS
RETURN
(
SELECT scd.SalesCd
FROM dbo.dimSalesCodes scd
WHERE scd.endDate > ISNULL(@TheDate, DATEADD(dd, DATEDIFF(dd, 0,...
December 12, 2010 at 3:27 am
ahmed7.bi (12/12/2010)
insert into test4 values (1,1,'asd')
go
insert into test4 values (2,1,'asd')
the command executed successfully
my query is that as i have included first...
December 12, 2010 at 2:33 am
ahmed7.bi (12/12/2010)
i have read that only one unique clustered index can be created on a table and many non clustered index
then how come the below commands works fine as...
December 12, 2010 at 2:30 am
The DATE datatype in SQL Server 2008 is exactly that - date without time. Try running SELECT CAST(GETDATE() AS DATE).
The script in your attachment will require a few changes to...
December 11, 2010 at 2:18 pm
Viewing 15 posts - 976 through 990 (of 1,229 total)