Viewing 15 posts - 241 through 255 (of 345 total)
SELECT * FROM INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE
May 19, 2011 at 8:37 am
craigbroadman (5/18/2011)
My question is, do I create generic tables, with alot of redundant columns for each type e.g.
...
Or, do I get specific and go a level down and create separate...
May 18, 2011 at 1:22 pm
PaulB-TheOneAndOnly (5/18/2011)
crainlee2 (5/16/2011)
I'm especially proud of this one:USE Master
DELETE FROM SYSOBJECTS
What do you think?
I think you have a great potential for a stand up comedian career 😀
I agree. I don't...
May 18, 2011 at 8:16 am
Stefan, your solution lists the staff members for that particular periodID. It seems to me he wants the staff that are not matched.
May 17, 2011 at 9:52 am
Working DDL for the adventurers:
create table tTimetable (DayID int, PeriodID int, StaffID int);
insert into tTimetable
values
(1,1,2),
(1,1,7),
(1,1,8),
(1,1,9),
(1,2,6),
(1,2,7),
(1,2,8),
(1,2,9),
(1,3,1),
(1,3,2),
(1,3,3),
(1,3,4),
(1,3,5),
(1,3,6),
(1,3,7)
create table tStaffTimeTableInfo (StaffID int, StaffInitials varchar(10));
insert into tStaffTimeTableInfo
values
(1,'ABC'),
(2,'RWT'),
(3,'YUJ'),
(4,'OPP'),
(5,'QWE'),
(6,'TFV'),
(7,'ASA'),
(8,'MNB'),
(9,'PLM')
drop table tTimetable;
drop table tStaffTimeTableInfo;
EDIT: he...
May 17, 2011 at 9:00 am
Mr Quillz (5/16/2011)
Hi Guys,I'm not a big fan of using sub-queries unless it is absolutely necessary to do so.
This is not a sub-query, it's a derived table and is...
May 16, 2011 at 10:47 am
Here is something we can work with. Start with a basic table create and some sample data.
create table SQL_List (Stmt_ID int identity(1,1), SQL_Stmt varchar(8000), File_location varchar(8000));
insert into SQL_List( SQL_Stmt, File_location)
select...
May 16, 2011 at 10:02 am
In step 2, what type of sql statements are you storing in the table?
May 16, 2011 at 8:39 am
I know all about the horrors of inherited code, so I know what you're going through. :w00t:
It seems like the author was using dynamic sql to conditionally append that last...
May 12, 2011 at 3:54 pm
The variables in the dynamic sql run in a different scope than the procedure. But it looks like you are not concatenating your variables into the sql string. When you...
May 12, 2011 at 1:55 pm
You can conditionally pick that value with a sub-select:
SELECT count(B.TRANS_TYPE) STARTS, B.PROD_CODE pcode, B.CODE CScode
FROM SUBS B
WHERE B.TRANS_DATE between '1/1/2011' AND '5/1/2011'
AND (B.TRANS_TYPE = '3'
OR
B.TRANS_TYPE =...
May 11, 2011 at 4:22 pm
mtassin (5/11/2011)...
At that point, just call the bloody thing a primary key.
So I see INT IDENTITY(1,1) and these days I assume PRIMARY KEY is stuck on the end of it.
Then...
May 11, 2011 at 10:50 am
This will get the bad children for you:
select s.stud_code, s.given_name, x.Num_Absences
from Student s
inner join
(
select stud_code, count(*) Num_Absences
from Student_Absent
group by stud_code
having count(*) > 2
) x on s.stud_code =...
May 10, 2011 at 3:09 pm
Your code is working perfectly fine for me, Greg. I created a folder in c:\temp called "todd's files" and as long as there is a file in that folder, the...
May 9, 2011 at 11:58 am
Viewing 15 posts - 241 through 255 (of 345 total)