Viewing 15 posts - 136 through 150 (of 443 total)
Hi...
DECLARE @MissingNumbers TABLE (N INT)
Declare @vMax int
INSERT INTO @MissingNumbers
VALUES (1),(2),(4),(5),(7),(8),(11),(12),(13),(15),(17),(19),(20)
Set @vMax = (Select MAX(N) from @MissingNumbers)
;with wcte as (
Select Top(@vMax) ROW_NUMBER() over(order by a.N) NAll
from @MissingNumbers a, @MissingNumbers b
) Select...
April 29, 2010 at 2:04 am
I have written this logic using sp_msforeachdb.
I need to ask Why have you used this condition
p.page_count >= 10
Is this to check if the Index is large enough to...
April 26, 2010 at 1:31 am
Had to change to run in SQL Server 2005. Just changed the initialization of @Loop ,@Qt and Total.
Nice script. Just want to know Which Language?
April 25, 2010 at 11:56 pm
Plz try the last query that i posted. It gives result;
A_RowID DataValueA B_RowID DataValueB
NULL NULL ...
April 25, 2010 at 10:17 pm
Hope ther is any way to find the nested tables as well.
In dependency, we get tables used with Insert, Update and Delete Operations. No way to find the tables used...
April 23, 2010 at 1:53 am
New version of my query,
Select Distinct * from (
SELECT a.RowID A_RowID, a.DataValueA, b.RowID B_RowID, b.DataValueB
FROM (Select *,Row_Number() over (order by Rowid) as rno from @TableA) a
LEFT OUTER JOIN (Select *,Row_Number()...
April 22, 2010 at 11:50 pm
Oh. Mistake in my query. I assumed that the Values of both tables will be same.
This was my test script...
Declare @vTable1 Table (id int, descr varchar(10))
Declare @vTable2 Table (id int,...
April 22, 2010 at 11:36 pm
sp_msforeachtable is a better option.
sp_msforeachDb is another useful procedure.
April 22, 2010 at 11:04 pm
Very Simple. I usually go with this strategy.
Good to share things like this. They can be very helpful to many.
April 22, 2010 at 11:00 pm
Hi,
I think your query should be like this...
Select * from (
SELECT a.RowID A_RowID, a.DataValueA, b.RowID B_RowID, b.DataValueB
FROM @TableA a
LEFT OUTER JOIN @TableB b ON b.RowID = a.RowID and b.DataValueB =...
April 22, 2010 at 10:45 pm
Never knew this. Had to use google to find the answer. 😀
April 22, 2010 at 10:20 pm
Dynamic SQL is your solution. I witnessed this scenario in a differen way. I had the Where clause as the parameter and I use to build the query depending upon...
April 22, 2010 at 6:06 am
I think the rownum is not the part of the table.
OP have to clear this. Otherwise the query is very simple.
April 22, 2010 at 6:02 am
Viewing 15 posts - 136 through 150 (of 443 total)