Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2009-04-13
1
Medium Priority
?
263 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 2000 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
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: …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

688 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