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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by Gooser

  1. Gooser

    How Do You Handle Temporal Data?

    born2program-- Thanks for the reply. Do you keep the current record in BOTH the CurrentPerson AND the HistoryPerson table? OR, do you do some sort of UNION of the two, (perhaps in a view,) to access both current and past records? Thanks, Gooser http://www.cafepress.com/SQLPimp
  2. Gooser

    How Do You Handle Temporal Data?

    How do you handle temporal data? I have requirements that suggest we need to know not just what the value of an attribute is today, but what that value was at any point in time. For example, if you get married this June 10th, queries would show your last name as it was BEFORE you were married...
  3. Gooser

    What is ITIL?

    Anybody work with ITIL? If so, any links to good resources would be exceptionally helpful. I have 11 days to get a decent, basic knowledge of what it is and how to implement. Thank you, Gooser
  4. Gooser

    Comments in Code Passed to sp_executesql

    I tried this and it worked: declare @try nvarchar(1000) set @try = 'Select * from <tablename> /*some comment*/' exec sp_executesql @try
  5. Gooser

    Comments in Code Passed to sp_executesql

    [CODE SQL] SET @newsql_1 = 'INSERT INTO @egbs_1 VALUES ( ' + @newsql_1 + ' )' EXEC sp_executesql @newsql_1 SELECT * FROM @egbs_1 [/CODE] This project is just a thorn in my side! Okay, so the code being passed to sp_executesql here, @newsql_1 had an ORDER BY clause in it. Of course, INSERT...
  6. Gooser

    Scope of a Table Variable in Relation to sp_executesql

    Isn't the overhead for that kind of large? You see, if I ever get this working I plan to put it into a loop that will run it about 60,000 times, (as part of a one-time data conversion effort, the source database isn't normalized so this seems to be the best/quickest way to extract the data I...
  7. Gooser

    Scope of a Table Variable in Relation to sp_executesql

    I'll try to simplify here since the code is thousands of lines long and unnecessarily complex. (not my code.) What I have is a stored procedure that builds SELECT statements based on literally hundreds of variables and then runs them. I don't wish to duplicate the logic (or even try to...
  8. Gooser

    Why doesn't this work?

    George, thanks (as usual), it turned out that what I thought held a SELECT statement held some other statements as well. (I didn't write that part.) The other statements declare a variable for a where clause, then set it's value, but they are never used. Yay for SUBSTRING()! I try to follow...
  9. Gooser

    Why doesn't this work?

    Other than the missing INTO keyword. ... D'OH!
  10. Gooser

    Why doesn't this work?

    INSERT @egbs_1 ( [risk_id], [risk_version_id], [contact_id], [risk_status_id], [risk_status_value], [risk_status_nm], [city], [state_cd], [state], [postal_cd], [extended_postal_cd], [county] ) VALUES ( exec sp_executesql @newsql_1 ) @newsql_1 contains a valid select...
  11. Gooser

    INSERT the Results of a Stored Procedure with Multiple SELECTs?

    George- There are 5 different SELECT statements in the stored procedure, I need to port the results of each into separate tables, i.e. RiskAddress, RiskDetails, RiskOwnerDetails, RiskConstructionDetails, RiskProtectionDetails. (For us, a "Risk" is a basic unit of work, it is an insurable...
  12. Gooser

    INSERT the Results of a Stored Procedure with Multiple SELECTs?

    RiverGuy, thanks for the response. However, I can't make changes to the stored procedure because it is also used to generate reports for another application. Any further ideas?
  13. Gooser

    INSERT the Results of a Stored Procedure with Multiple SELECTs?

    I have a stored procedure (which is overly complex and written by someone else) that I need to take the results of and put them into tables. The stored procedure uses Dynamic SQL to build and then run 5 SELECT statements based on literally hundreds of variables. I need to take the results of...

Part and Inventory Search

Back
Top