Viewing 15 posts - 1 through 15 (of 23 total)
It still isn't needed. The example below shows a join without a derived table to get whatever info you want. I only checked for dups in the firstname/lastname fields because that...
March 24, 2006 at 11:49 am
I don't like MUCK tables even though I have used them and inherited them. The integrity just isn't there.
The only advantage is that they require only 1 screen in the...
March 24, 2006 at 11:40 am
I would also recommend that you use a standard across the database.
The two most common ways are:
March 22, 2006 at 10:07 am
I think this does it.
declare @birth smalldatetime
declare @now smalldatetime
select @birth = '3/22/1988'
-- Gets todays date without the time
select @now = convert(varchar(12),getdate(),101)
if (dateadd(yy,-18,@now) >= @birth)
select 'older than 18'
else
select 'younger...
March 22, 2006 at 9:56 am
You could also script the stored procedures out of the db using the generate sql script functionality. This can script them to one file where you could use find. You...
March 22, 2006 at 9:45 am
A derived table is not needed here. Just run this query
SELECT FirstName, MiddleName, LastName, DateOfBirth
FROM table
GROUP BY Firstname,
MiddleName
LastName
DateOfBirth
HAVING count(*) > 1
March 22, 2006 at 9:43 am
Might as well give you the not exists option as well
INSERT INTO table1
SELECT * FROM table2 t2 WHERE NOT exists (SELECT 1 FROM table1 t1 where t1.id = t2.id)
January 18, 2006 at 3:13 pm
Create a table with two columns. One will be where in the process the sp is the other is the time. Now go to your proc and throughout...
January 17, 2006 at 9:19 pm
The script I posted does what you are wanting. Is there some reason it won't work?
Chris
January 9, 2006 at 10:07 am
Since no one else is doing it, here goes the identity argument.
Use an identity. Also create a unique index on the vendor/bar code columns. Everyone here...
January 6, 2006 at 4:07 pm
Here is what I came up with. Basically if you have a recursive relationship, you have to walk down it. You can use a cursor or a while...
January 6, 2006 at 3:24 pm
This should do it...
SELECT dt.*,
case when RenewalsDue = 0 then 0
else (NumberRenewed * 100.0) / RenewalsDue end As PercentRenewed
FROM
( -- derived table starts here
SELECT ...
January 6, 2006 at 10:56 am
I agree with a previous post about the size of the tables. If table3 has 10 million rows, why not check for existence in the student table. Of...
January 6, 2006 at 10:36 am
The case statement is used in the select clause not the join clause. i think what you are trying to do is accomplished by the following code.
CREATE PROCEDURE prcTestCase
(@BeginDate...
January 6, 2006 at 10:03 am
Is your inner cursor performing an update? What is the sp doing?
January 6, 2006 at 9:56 am
Viewing 15 posts - 1 through 15 (of 23 total)