Solved

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

Posted on 2009-04-13
1
255 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
[X]
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
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
In this article I will describe the Copy Database Wizard 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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

622 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