Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

sql errors

Posted on 2014-04-03
2
216 Views
Last Modified: 2014-04-03
Below is code I am using and error messages I encounter after executing. Could somebody tell me what is wrong with this? Thanks in advance...

Code...
declare @JobNumb varchar(10),
      @WorkOrderNumb varchar(10,
      @JobNumb_WorkOrderNumb varchar(20)

set @JobNumb = '99999'
set @WorkOrderNumb ='99'
set @JobNumb_WorkOrderNumb = @JobNumb+@WorkOrderNumb

Messages...
Msg 102, Level 15, State 1, Line 7
Incorrect syntax near '@JobNumb_WorkOrderNumb'.
Msg 137, Level 15, State 1, Line 9
Must declare the scalar variable "@JobNumb".
Msg 137, Level 15, State 1, Line 10
Must declare the scalar variable "@WorkOrderNumb".
Msg 137, Level 15, State 2, Line 11
Must declare the scalar variable "@JobNumb".
0
Comment
Question by:tesla764
  • 2
2 Comments
 

Accepted Solution

by:
tesla764 earned 0 total points
ID: 39975074
Solved - I just noticed a   )    is missing on the 2nd line.
0
 

Author Closing Comment

by:tesla764
ID: 39975079
Solved.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question