473,386 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Error in executing a SQL stored procedure

I get this error:
Line 1: Incorrect syntax near '.'

when executing my stored procedure:
ALTER PROCEDURE Test

(
@Func VarChar(100)
)

AS
DECLARE @SQL VarChar(100)

SET @SQL = 'SELECT DISTINCT dbo.ResultSummary.TestName FROM dbo.ResultSummary, dbo.SuiteNameHierarchy' /*WHERE dbo.SuiteNameHierarchy.[Function] LIKE @Func'*/

IF @Func IS NOT NULL
SET @SQL = @SQL + 'WHERE dbo.SuiteNameHierarchy.[Function] LIKE @Func'

EXEC(@SQL)
RETURN

Any help?
Nov 1 '07 #1
4 1448
jhardman
3,406 Expert 2GB
What language is this? The ASP forum is for classic ASP and VBScript questions. Let me know, and I will move your post where it belongs.

Jared
Nov 2 '07 #2
This is a SQL stored procedure for my ASP project. It is related to ASP, isnt it?
Nov 2 '07 #3
jhardman
3,406 Expert 2GB
This is a SQL stored procedure for my ASP project. It is related to ASP, isnt it?
Oh, I see. I just assumed since the code you posted wasn't ASP and ASP wasn't mentioned in the post that you had stumbled into the wrong forum. I don't like using stored procedures since I'm better with ASP than I am with SQL, but how about posting your procedure call?

Jared
Nov 3 '07 #4
Never mind. I know where the error is. @SQL is declared as Varchar(100) and my query had more than 100 characters! :-)
Nov 5 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: dtwilliams | last post by:
OK, i'm trying to do some error checking on stored procedures and am following the advise in Erland Sommarskog's 'Implementing Error Handling with Stored Procedures' document. Can anybody help...
0
by: Rhino | last post by:
I've written several Java stored procedures now (DB2 V7.2) and I'd like to write down a few "best practices" for reference so that I will have them handy for future development. Would the...
3
by: Goog79 | last post by:
Hi everyone, first time here, so I'm sorry if this has been covered already ages ago. :( I am trying to learn T-SQL and Stored Procedures and bought the book on these topics by Djan...
0
by: preejith | last post by:
I am getting the following error while running a stored procedure in mysql5.0 Error Code : 1329 No data - zero rows fetched, selected, or processed. I have an stored procedure SP1 which calls...
1
by: preejith | last post by:
Error Code : 1329, No data - zero rows fetched, selected, or processed. MYSQL I am getting the following error while running a stored procedure in mysql5.0 Error Code : 1329 No data - zero rows...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.