Results 1 to 9 of 9

Thread: SQL Server timeout

  1. #1

    Thread Starter
    Junior Member hellilyntax's Avatar
    Join Date
    Jun 2006
    Location
    Kedah, Malaysia
    Posts
    28

    SQL Server timeout

    hi guys,
    before i come to my problem, ill let you know my app architecture.
    i have a vb program to update my sql server database which is located at hosting company.
    the program will transfer every rows in Excel on local pc to MSSQL table on server.

    the problem is, it takes too long to complete the transaction because it involves thousands of rows (up to 10000). when i try, it only can execute 800 rows and the connection will break.

    do you have any idea to overcome this...
    is there anything to do with
    1. connection speed
    2. sql statement
    3. architecture itself
    4. is it possible to execute 10000 rows over the net?
    5. do i have to have the SQL Server on local so that the journey can be faster?

    please give me some idea....

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: SQL Server timeout

    Easiest and most stable way to do an import of Excel to SQL Server is to use DTS Import. You can designate the Excel file and destination table and save the package. Then execute it manually or via a Job or code etc.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Junior Member hellilyntax's Avatar
    Join Date
    Jun 2006
    Location
    Kedah, Malaysia
    Posts
    28

    Re: SQL Server timeout

    thanks dude,
    ill look at DTS first and come back later...

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: SQL Server timeout

    DTS is only going to be effective if it's run on the server (as it's designed to).....

    Apart from that.... when you create your command object, you can also set the CommandTimeout property. By default it is about 30 seconds (If I remember right). You can extend it by setting it to a new value (in number of seconds)... we use 300 (which is 5 minutes) which seems to work for us.

    -tg

    OG Tay sez: OW! Not the face! Not the face!
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: SQL Server timeout

    Good suggestion TG as I see his db is located at hosting company so increasing the timeout property is the better way to go.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: SQL Server timeout

    Post #4.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Junior Member hellilyntax's Avatar
    Join Date
    Jun 2006
    Location
    Kedah, Malaysia
    Posts
    28

    Re: SQL Server timeout

    i now try with new value...3000 is that enough for 10000 rows?
    command timeout means attemp to execute one sql right?
    am i too greedy?
    Last edited by hellilyntax; Aug 6th, 2006 at 03:40 PM.

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: SQL Server timeout

    The unit is seconds and there is no formula for a row per second value. It varies as according to connection speed, traffic, server loads, etc.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9

    Thread Starter
    Junior Member hellilyntax's Avatar
    Join Date
    Jun 2006
    Location
    Kedah, Malaysia
    Posts
    28

    Re: SQL Server timeout

    when i put 3000sec does it means server will wait for any command for 3000sec. if no command wthin that period, it will break the connection.
    -or-
    the server only provide 3000sec to complete all command.after that it will terminate the connection.

    which one is right? correct me if im wrong....

    fyi, currently the process took about 1sec per row and reach 1000 rows with constant speed...

    damn, it breaks at 1133 rows....i want to sleep right now...
    if you have othe idea...help me please...
    Last edited by hellilyntax; Aug 6th, 2006 at 04:01 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width