Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. woodpd

    INSERT EXEC without defining table structure

    vongrunt: Trying other options apart from the Stored Procedure method mentioned at the top which won't work.
  2. woodpd

    INSERT EXEC without defining table structure

    I did look into that. Here is my attempt: CREATE FUNCTION dbo.udf_ReportMaster (@Filters varchar(4000), @Company int, @User int) RETURNS @ReportMaster TABLE ([ImprovementID] [bigint] NOT NULL, [MU_Employee_DepartmentID] [bigint] NOT NULL, ....... [ReminderDate] [smalldatetime] NULL) AS BEGIN...
  3. woodpd

    INSERT EXEC without defining table structure

    First thought, yes I need every single column as the various filters and reports that use this system are varied and wide, using every single column in the Improvement table. As new columns are added, new reports and filters are often added too! Second thought, I hoped no one would say that...
  4. woodpd

    INSERT EXEC without defining table structure

    This one's been bugging me all night. OK, at present this is what I do. I have a stored procedure (usp_ReportMaster) which returns the result of a dynamic SQL query like this: SELECT Improvement.* FROM .......... I then have many other stored procedures that run the above stored proc first and...
  5. woodpd

    Distinct select problems

    Thanks mate, worked a treat. I just got stuck in my thinking of trying to use DISTINCT (which I don't think would have worked). So easy when new eyes look at the problem!!
  6. woodpd

    Distinct select problems

    Scaled down table structure: TblCustomer: CustomerID FirstName Surname etc TblEnquiry: EnquiryID CustomerID Source etc I am trying (as part of a larger query) to get a list of the EnquiryIDs for a customer's most recent enquiry (therefore the list will only have 1 entry for each customer...
  7. woodpd

    Impossible SQL query?

    I have been given a solution already:- Alias the table name. Thanks guys FYI Select m.Match_date, t1.Teamname, t2.Teamname from team t1, team t2, match m where m.HomeTeamID = t1.TeamID and m.AwayTeamID = t2.teamID
  8. woodpd

    Impossible SQL query?

    Cheers mate, I never knew you could create aliases for table names (or whatever you call it). I've had that problem before and side stepped the issue with 2 queries (crap I know!!). Ingenius (or maybe I should just learn SQL properly!) ChoPa
  9. woodpd

    Impossible SQL query?

    Dear people, I am tearing my hair out trying to write an SQL statement to do the following: In Table "Team" amongst other things I have a "TeamID" and a "TeamName". In Table "Match" amongst other things I have a "HomeTeamID" and an...
  10. woodpd

    Impossible SQL query?

    Dear people, I am tearing my hair out trying to write an SQL statement to do the following: In Table "Team" amongst other things I have a "TeamID" and a "TeamName". In Table "Match" amongst other things I have a "HomeTeamID" and an...

Part and Inventory Search

Back
Top