Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 2nd, 2004, 04:14 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Default sql server and asp if statement

is there any way to use an if statement in a SQL Server.
I have written a code in an asp. I want to check the code
in SQL.

    strUpdate = "update tblCustRate set dtRateFrom =" & ndateFrom & _
                ", dtRateTo =" & ndateUntil& _
                ", decHourlyRate=" & nHourlyRate
                '" where iEmpID=" &iEmpID&_
                '" and iTaskID= " & iTaskID &_
                '" and iProjDetID=" & iProjDetID
        if resType ="E" then
         strUpdate= strUpdate & " where iEmpID= " & iEmpID &_
                  " and iTaskID= " & iTaskID &_
                  " and iProjDetID=" & iProjDetID
         else
          strUpdate=strUpdate & " where iSubcontID = " & iSubcontID &_
                  " and iTaskID= " & iTaskID &_
                  " and iProjDetID= " & iProjDetID
         end if

 
Old November 2nd, 2004, 06:50 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can create a Stored Procedure in SQL Server.

IF <Boolen Expression>
BEGIN
   Your SQL Statements
END
ELSE
BEGIN
   Your SQL Statements
END
 
Old November 2nd, 2004, 07:38 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Default

will any one write the stored procedure. Since I am the new to the sql. I dont know how? Thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP- SQL Server..Query help.... cancer10 Classic ASP Databases 5 February 1st, 2007 06:26 AM
sql statement for asp.net page carswelljr SQL Server 2005 2 August 28th, 2006 01:05 PM
Access to sql server from Asp 3.0 jupiter3437 Classic ASP Databases 0 November 15th, 2005 01:07 AM
How Can SQL Server working with ASP??? aliasp SQL Server ASP 1 March 18th, 2004 03:13 PM
ASP sql select statement scorpio Classic ASP Databases 5 July 30th, 2003 06:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.