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 Mike Lewis 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. mattpont

    Delete Trigger - inserts a record

    CREATE TRIGGER userDelete ON tbl_test FOR DELETE AS INSERT INTO tbl_test1 (test_A) ((SELECT test_A FROM Deleted)) I managed it with this. Thanks for your guidance SQLSister!
  2. mattpont

    Delete Trigger - inserts a record

    I couldn't get it to work with using "Select * From Deleted", but I managed to get a simple example working by using the code below: CREATE TRIGGER dbo.userDelete ON tbl_test FOR DELETE AS DECLARE @test_A AS varchar(50) SET @test_A = (SELECT test_A FROM Deleted) INSERT INTO dbo.tbl_test1...
  3. mattpont

    Delete Trigger - inserts a record

    Ok, I'm very new to triggers so please excuse my ignorance. I want the following to happen: - user deletes row from a database - row gets inserted into a backup table Is this possible with a Delete trigger? Basically a client wants rows to be saved in another table when they delete (so they...
  4. mattpont

    SMTP using wrong port

    Thanks guys, there is a queue, but only for 2 days so we've lost quite a few. Ho Hum.
  5. mattpont

    SMTP using wrong port

    A webform written using PHP was meant to send out emails via SMTP. However the port was set to 30 rather than 25 and therefore the emails were never sent. Is there any hope of retrieving the emails (the data inside - not just what is stored in the logs, i.e. who sent, where, and when)? Or am...
  6. mattpont

    Ordering By Numeric, then by alphanumeric

    Wicked, works perfectly. Thanks for both of your very swift reponses.
  7. mattpont

    Ordering By Numeric, then by alphanumeric

    Hi, I have a data table with shop products in it. I want to order the data on the 'size' column. This can be shoe size (9, 10, etc) or it could be shirt size (Large, Medium, etc). When I order by alphanumeric, the shoe size list looks wrong as it shows this: 10, 10.5, 11, 11.5, 6, 7, 8, 9...
  8. mattpont

    Trying to close a popup after a download

    I am doing it from ASP, but it doesn't have to be. It's just the way I started doing it. I'll try the Javascript way... Ta
  9. mattpont

    Trying to close a popup after a download

    Hi, I have a popup window, which asks a user to tick 2 tickboxes in order for them to download a zip file. Once they have ticked the boxes, the page redirects to the zip file which downloads no probs. The 'problem' is that the popup remains. I want to close this popup automatically, but I...
  10. mattpont

    Is this SQL Injection or something else?

    The SQL Server is behind a firewall. How do I remove exec permissions from sp_OACreate? Thanks
  11. mattpont

    Is this SQL Injection or something else?

    Hi everyone. Our SQL Server has stopped twice in the last week. I restart it and everything starts working okay again. When it 'stops', I get this error when I try and use a website that uses the SQL Server database: [Microsoft][ODBC SQL Server Driver][DBNETLIB]General network error. Check...
  12. mattpont

    Can this be done using a trigger?

    Cool, thanks everyone. It's working now.
  13. mattpont

    Can this be done using a trigger?

    Ok, the goalposts have been moved again by my client. I now need test_updated to be the opposite of the other columns. i.e. when test_A, test_B and test_C ALL equal to 0, test_updated must be 1. And if any of them equal 1, then test_updated = 0. I hope you understand me!
  14. mattpont

    Can this be done using a trigger?

    Wicked. Thanks, that worked fine. Although I've made a bit of a cock up. The field type's of test_a, test_b, test_c and test_updated should be BIT instead of INT! Your code stops working when I make these changes to my table. Can it be tweaked so it will work with BITs rather than INTs? Thanks
  15. mattpont

    Can this be done using a trigger?

    Yeah, thanks. I'd got that far, but I just don't really have a clue about the code afterwards! Can anyone help me with this part? Thanks
  16. mattpont

    Can this be done using a trigger?

    I have a table called tbl_test: test_id, int, (Primary Key) test_A, int test_B, int test_C, int test_updated, int Basically, I want the value of test_updated to be 0 if test_A, test_B and test_C are all 0. And the value of test_updated to be 1 if any of test_A, test_B or test_C are set to 1...
  17. mattpont

    Dynamic field value

    Ok, thanks, I thought that Triggers may be a solution. I've been googling them for the past hour. Does anyone have experience of SQL triggers and could show me what I need to do in order to get this to work?
  18. mattpont

    Dynamic field value

    In my SQL Server database, I want a new field in my table called something like 'UPDATED'. I want this to be defaulted to FALSE. If fields x, y or z are set to TRUE then I want the value of UPDATED to be changed to TRUE as well. And then, if x, y and z are ALL changed to FALSE, then the value...
  19. mattpont

    ODBC--call failed - Timeout when using linked table to SQL Server

    Hi, I'm trying to use a linked table from Access 2003 to SQL Server 8.0. It's a link using a ODBC connection, and it worked fine when there were just a few records in the remote table. Now there are over 2000 records and I'm getting these errors: "ODBC--call failed" and "cannot generate SSPI...
  20. mattpont

    SQL Join two tables with a twist

    Wicked. That seems that have done the trick, thankyou everyone for your very quick and accurate responses. Cheers.

Part and Inventory Search

Back
Top