Solved

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

Posted on 2009-04-13
1
234 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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now