T-SQL with ASP pages

Results 1 to 4 of 4

Thread: T-SQL with ASP pages

  1. #1
    Tony V. Guest

    Default T-SQL with ASP pages

    I&#039m currently rebuilding some of my VBScript routines into T-SQL routines because it&#039s what my boss wants. Here&#039s my script:<BR> conn.execute "declare @updatecheck ntext(16) " _<BR> & "declare @dataoutput ntext(16) " _<BR> & "declare @rsOutput ntext(16) " _<BR> & "select @updatecheck = &#039" & session"updatecheck") & "&#039 " _<BR> & "if (@updatecheck = &#039&#039)" _<BR> & " select @rsOutput = " & session"dataoutput") & " and MainData.Ticket_ID = " & TheCustNo & session("updatestore") & " " _<BR> & "else " _<BR> & " select @rsOutput = " & session("updatecheck") & ""<BR><BR><BR>And here&#039s the session("dataoutput") data:<BR>select * from MainData, Jobs where MainData.Ticket_Last_Name = &#039Meecham&#039 and MainData.Ticket_ID = Jobs.CustNo<BR><BR>When I do this, I get an "Incorrect syntax near the keyword &#039select&#039." error. I&#039ve tried placing apostrophes around my T-SQL variable declarations, but I get an "Line 1: Incorrect syntax near &#039Meecham&#039." error. Any suggestions would be greatly appreciated!<BR><BR>Tony

  2. #2
    Nathen Guest

    Default RE: T-SQL with ASP pages

    Why don&#039t you create all your SQL statements as stored procedures on your database server. Your database server will provide better debugging for your SQL statements and you can just use ASP and ADO to call the stored procs.

  3. #3
    Tony V. Guest

    Default RE: T-SQL with ASP pages

    I&#039ve never actually made stored procedures on SQL Server 7.0 before. Where would I go to do that?<BR><BR>Thanks in advance!<BR>Tony

  4. #4
    Tony V. Guest

    Default Read first - thanks!

    Boy, I&#039m brilliant. I just found the stored procedure location. Thanks for the advice!<BR><BR>Tony

Posting Permissions

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