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

Unable to insert data into SQL 2008 Table when running "Execute Stored Procedure" from SSMS

Posted on 2009-04-13
1
245 Views
Last Modified: 2012-05-06
These are the values I enter into the following columns on a Table named Main.
Workstation = COOLWD,
Username = Domain\Username,
Domain = Top.Middle.com,
WakeUpType = 6,
MacAddress = 00:c1:4a:f5:66:8c,
WkstnStatus = Ok
So, I go to Stored Procedures in SSMS 2008, right-click on the stored Procedure named "usp_InsertToPCDATA" and select "Execute Stored Procedure". When I do that I get the following error --> Msg 102, Level 15, State 1, Line 9
Incorrect syntax near ':'."
So, it doesn't like the semi-colon. Do I need to set a different "MacAddress" to a different datatype and if so, what? Eventually this data will be updated by a C# Console app.
Thanks Experts,
Wally
USE [PCDATA]
GO
 
DECLARE	@return_value int
 
EXEC	@return_value = [dbo].[usp_InsertToPCDATA]
		@WorkstationName = N'COOLWD',
		@UserName = N'Domain\Username',
		@Domain = N'Top.Middle.com',
		@WakeUpType = 6,
		@MacAddress = 00:c1:4a:f5:66:8c,
		@WkstnStatus = N'Ok'
 
SELECT	'Return Value' = @return_value
 
GO

Open in new window

0
Comment
Question by:wally_davis
1 Comment
 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 500 total points
ID: 24133804
Yes, you have to give : values which are Varchar / Char inside a single quotes.
Try this one out:

EXEC    @return_value = [dbo].[usp_InsertToPCDATA]
                @WorkstationName = N'COOLWD',
                @UserName = N'Domain\Username',
                @Domain = N'Top.Middle.com',
                @WakeUpType = 6,
                @MacAddress = '00:c1:4a:f5:66:8c',
                @WkstnStatus = N'Ok'
 
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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