• WSBender

    WSBender

    @wsbender

    Viewing 15 replies - 46 through 60 (of 68 total)
    Author
    Replies
    • in reply to: Run stored proc between two dates #1330367

      Using SQL Server Agent, as ruirib suggested, to kick off this routine at whatever time of the day you require, you can do this by providing the start and end data as parameters;

      Code:
      [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]
      CREATE [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]PROCEDURE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [dbo][/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][MyBackgroundTask] [/SIZE]
      [SIZE=2]
      @StartDate [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]DateTime[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080],[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080]
      [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]@EndDate [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]DateTime[/COLOR][/SIZE][/COLOR][/SIZE]
      [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]
      AS
      
      BEGIN
      [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]    
      [/SIZE][INDENT][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]DECLARE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] @DateTimeNow    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]DateTime[/COLOR][/SIZE][/COLOR][/SIZE]
      [SIZE=2]    
      [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]SELECT[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] @DateTimeNow [/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080]= [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#ff00ff][SIZE=2][COLOR=#ff00ff]GETDATE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080]()[/COLOR][/SIZE][/COLOR][/SIZE]
      [SIZE=2]
      [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]IF[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] @DateTimeNow [/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080]BETWEEN[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] @StartDate [/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080]AND[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] @EndDate[/SIZE][SIZE=2]
      
      [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]BEGIN[/COLOR][/SIZE][/COLOR][/SIZE]
      [SIZE=2] 
      [/SIZE][/INDENT]
      [INDENT=2][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]EXEC[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [MyDatabaseName][/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][dbo][/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][MyStoredProcedureName][/SIZE][/INDENT]
      [INDENT][SIZE=2]
      [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]END
      [/COLOR][/SIZE][/COLOR][/SIZE][/INDENT]
      [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]END
      
      GO
      [/COLOR][/SIZE][/COLOR][/SIZE]
      

      If you want to embed the start and end dates in the stored procedure then you can do this;

      Code:
      [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]
      CREATE [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]PROCEDURE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [dbo][/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][MyBackgroundTask] [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]
      AS
      
      BEGIN
      [/COLOR][/SIZE][/COLOR][/SIZE][INDENT][SIZE=2][SIZE=2][SIZE=2][COLOR=#0000ff]DECLARE[/COLOR] [/SIZE]@StartDate [COLOR=#0000ff][COLOR=#0000ff]DateTime[/COLOR][/COLOR][COLOR=#808080][COLOR=#808080],[/COLOR][/COLOR][/SIZE][COLOR=#808080][COLOR=#808080]
      [/COLOR][/COLOR][SIZE=2][SIZE=2][COLOR=#0000ff]DECLARE[/COLOR] [/SIZE]@EndDate [COLOR=#0000ff][COLOR=#0000ff]DateTime[/COLOR][/COLOR][/SIZE][/SIZE][/INDENT]
      [INDENT][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]DECLARE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] @DateTimeNow    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]DateTime[/COLOR][/SIZE][/COLOR][/SIZE]
      [SIZE=2]    
      
      [SIZE=2][COLOR=#0000ff]SELECT[/COLOR] @[SIZE=2]StartDate [/SIZE][COLOR=#808080][COLOR=#808080]= ‘4/1/2012’[/COLOR][/COLOR][/SIZE]
      [SIZE=2][COLOR=#0000ff]SELECT[/COLOR] @[SIZE=2]EndDate [/SIZE][COLOR=#808080][COLOR=#808080]= ‘4/30/2012’[/COLOR][/COLOR][/SIZE]
      [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]SELECT[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] @DateTimeNow [/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080]= [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#ff00ff][SIZE=2][COLOR=#ff00ff]GETDATE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080]()[/COLOR][/SIZE][/COLOR][/SIZE]
      [SIZE=2]
      [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]IF[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] @DateTimeNow [/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080]BETWEEN[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] @StartDate [/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080]AND[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] @EndDate[/SIZE][SIZE=2]
      
      [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]BEGIN[/COLOR][/SIZE][/COLOR][/SIZE]
      [SIZE=2] 
      [/SIZE][/INDENT]
      [INDENT=2][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]EXEC[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [MyDatabaseName][/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][dbo][/SIZE][SIZE=2][COLOR=#808080][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][MyStoredProcedureName][/SIZE][/INDENT]
      [INDENT][SIZE=2]
      [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]END
      [/COLOR][/SIZE][/COLOR][/SIZE][/INDENT]
      [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]END
      
      GO
      [/COLOR][/SIZE][/COLOR][/SIZE]
      
    • in reply to: Junk e-mail: can I retaliate? #1308712

      You can submit spam to Spamcop at http://www.spamcop.net.

      You have to know how to paste in the entire raw message, headers and all and it’ll automatically figure out who to complain to and do so on your behalf, while also gathering data and adding to their DNS blocklist. It’s a little kludgy submitting with a 7-second delay, but I use it from time to time when I see messages that the various blocklists aren’t aware of.

      Ditto! I too had become aggravated to the point of enough is enough. I report EVERY piece of spam mail that I get to SpamCop. Sometimes it takes a few weeks to see results but eventually it (the spam) goes away… at least in my experience.

    • in reply to: Can ping computer by IP address but not by computer name #1297164

      Make sure the notebook network location is not set to Public. This sounds like a work computer so it should be set for the ‘Work network’ if that’s the case. Take a look at your network discovery settings in Control Panel -> Network and Sharing Center -> Change advanced sharing settings (Home or Work)

      Turn on network discovery and then check Homegroup connections. I use the User Accounts and passwords options to connect to other computers. This means you have to have an account on the server to make the connection. Your situation may be different though.

      Anyway, see if that gets you there.

    • in reply to: MSSQL 2000 error #1297158

      Do you know how to use Enterprise Manager? If so then take a look at the properties of the tempdb database and make note of the default collation name. That will be under the ‘General‘ tab in the ‘Maintenance‘ section. Next check the default collation name for your working database. If they are different then chances are the default collation was incorrectly specified when installing the database server. Here’s an article that explains that; http://msdn.microsoft.com/en-us/library/aa214328(SQL.80).aspx

      The next question is, does the time clock software perform the database server installation automatically or is that something that you do as a manual step? If it’s a manual installation then you should check a known good install to see what the default collation is then perform a re-install making sure that you specify the correct collation name. If the db server is automatically installed then the mystery deepens as to why the installation isn’t consistent with the other installs.

    • in reply to: Copying files from FTP location via VBA #1297035

      Here’s a VB basic module (see attached file) that I created some years ago for FTP Puts and Gets using API calls. It worked using some older version of IE components (I don’t remember the version) under XP. You’re welcome to try it out. If you can use a bas module in your project then just rename the file extension to .bas

      You’ll want to focus on the Public subs and the incoming arguments.

    • in reply to: Column heading ‘from’ #1297025

      This is the way it works in OL 2010 and *maybe* earlier versions, but I’m not sure. If you left select (holding the left mouse button aka “dragging”) a column header and move it above or below the column headers row, it gets removed. You will see a graphic ‘X’ to indicate what’s getting ready to happen. To get it back, right click the column header and select ’View Settings’ from the pop-up menu. Select the Columns button, then pick the desired column from the ’Available Columns’ list and add it to the ‘Shown Columns’. At this time you can also adjust the order of the Shown Columns.

    • in reply to: Examples using Access database #1263192

      John,

      See if this tutorial is of any help. I believe it uses the Northwind database;

      http://www.techotopia.com/index.php/Accessing_Databases_Using_Visual_Basic

    • in reply to: Connecting to Server ??? #1258951

      StartTask Manager and look at the Processes. Sort the processes by the cpu column, with the highest cpu usage being at the top. Try to connect up with your email server and see if there is anything that may be meddling with your connection attempt, such as AV software or the firewall. That’s a good place to start your investigation and we can move on from there.

    • in reply to: Allow a new Limited User to access programs #1258893

      There’s a lot you can do by setting the local group policy. There’s tons of articles like this;

      http://blogs.techrepublic.com.com/10things/?p=1014

      Just do a search for Windows 7 user policy or Windows 7 local group policy

      Use caution with the policy editor as you can lock your own self out of Windows if you’re not careful, in addition to other unintended results.

    • in reply to: Cannot find Installable ISAM #1258773

      When you install Microsoft Office there’s an option to install additional components, such as ODBC drivers and so forth. This is a shot in the dark but perhaps she could put the installation CD back in and select the “add features” option and have her select all the options for Access to see if that gets things going.

    • in reply to: Update Query and Case #1258347

      You didn’t specify which type of database you were using. Here’s how you do a case sensitive match in TSQL;

      http://sqltips.wordpress.com/2007/05/14/case-sensitive-string-comparison-in-sql-server-2005/

    • in reply to: Copying an Appointment #1257742

      Instead of “drag and drop”, copy Ctrl-C and paste Ctrl-V. Just click the appropriate date and paste.

    • in reply to: Camcorder firewire to USB #1257741

      Not every USB device is automatically recognized. Were there any drivers (installation) that came with the converter?

      You got a brand name and model number for this converter?

    • in reply to: Connecting one notebook to another's CD drive #1257652

      can someone tell me the easiest way to hook up two laptops to use a working cdrom on one to install an OS on the other (cdrom not working)? I got into the bios and there is no option to boot from a flash drive. thanks for any help. Not even close to being “tech minded”, appreciate it.

      Does the target computer have (a) a floppy drive AND (b) a network interface???

    • in reply to: Any McAfee Enterprise Experts Out There? #1257650

      You need to create a new policy for the machine that sends the email. The IT bods will need to do this for you.

      Thanks!

    Viewing 15 replies - 46 through 60 (of 68 total)