Click here to Skip to main content
15,893,190 members
Home / Discussions / Database
   

Database

 
Questionhelp on SP (edit / insert) Pin
firestoper1-Mar-07 1:05
firestoper1-Mar-07 1:05 
AnswerRe: help on SP (edit / insert) Pin
Pete O'Hanlon1-Mar-07 1:42
mvePete O'Hanlon1-Mar-07 1:42 
GeneralRe: help on SP (edit / insert) Pin
firestoper1-Mar-07 2:06
firestoper1-Mar-07 2:06 
GeneralRe: help on SP (edit / insert) Pin
Pete O'Hanlon1-Mar-07 2:45
mvePete O'Hanlon1-Mar-07 2:45 
GeneralRe: help on SP (edit / insert) Pin
firestoper1-Mar-07 12:35
firestoper1-Mar-07 12:35 
AnswerRe: help on SP (edit / insert) Pin
gauthee1-Mar-07 1:45
gauthee1-Mar-07 1:45 
GeneralRe: help on SP (edit / insert) Pin
firestoper1-Mar-07 2:10
firestoper1-Mar-07 2:10 
QuestionError on SP I made Pin
firestoper1-Mar-07 0:36
firestoper1-Mar-07 0:36 
Hi Guru's

Im somehow stuck with the procedure I made, can you help me out with this, its a simple select but I put it on a declared variable.

Here's the code
SET ANSI_NULLS ON<br />
SET QUOTED_IDENTIFIER ON<br />
GO<br />
<br />
alter PROCEDURE trc_spVisitorPath<br />
(<br />
<br />
	@visitorID int = 0<br />
<br />
)<br />
<br />
as<br />
	begin<br />
	declare @Sel_Pageview varchar(255)<br />
<br />
		set @Sel_Pageview = <br />
		'select <br />
			convert(char(11),DateEntered) as ''Date Entered'', <br />
			browser,<br />
			platform,<br />
			MajorVersion,<br />
			MinorVersion<br />
		from<br />
			visitors <br />
		where <br />
			visitorID = ' + @visitorID<br />
<br />
	end<br />
<br />
	begin<br />
	declare @Sel_Visitor varchar(255)<br />
	<br />
		set @Sel_Visitor = <br />
		'select <br />
			convert(char(13),DateEntered) as ''Date Entered'',<br />
			PageName as ''Page Name''<br />
		where<br />
			visitorID = ' + @visitorID<br />
	end<br />
<br />
exec(@Sel_Pageview)<br />
exec(@Sel_Visitor)


I'm getting this error after I run it

Msg 245, Level 16, State 1, Procedure trc_spVisitorPath, Line 13<br />
Conversion failed when converting the varchar value 'select <br />
			convert(char(11),DateEntered) as 'Date Entered', <br />
			browser,<br />
			platform,<br />
			MajorVersion,<br />
			MinorVersion<br />
		from<br />
			visitors <br />
		where <br />
			visitorID = ' to data type int.

thanks
Dom
AnswerRe: Error on SP I made Pin
Paddy Boyd1-Mar-07 0:44
Paddy Boyd1-Mar-07 0:44 
GeneralRe: Error on SP I made Pin
firestoper1-Mar-07 0:56
firestoper1-Mar-07 0:56 
QuestionIntersect in SQL Server2000 Pin
Prashant C28-Feb-07 23:34
Prashant C28-Feb-07 23:34 
AnswerRe: Intersect in SQL Server2000 Pin
Krish - KP28-Feb-07 23:52
Krish - KP28-Feb-07 23:52 
AnswerRe: Intersect in SQL Server2000 Pin
gauthee1-Mar-07 0:06
gauthee1-Mar-07 0:06 
QuestionRe: Intersect in SQL Server2000 Pin
Prashant C1-Mar-07 0:39
Prashant C1-Mar-07 0:39 
AnswerRe: Intersect in SQL Server2000 Pin
Harini N K1-Mar-07 0:45
Harini N K1-Mar-07 0:45 
AnswerRe: Intersect in SQL Server2000 Pin
Harini N K1-Mar-07 0:54
Harini N K1-Mar-07 0:54 
GeneralRe: Intersect in SQL Server2000 Pin
Prashant C1-Mar-07 1:11
Prashant C1-Mar-07 1:11 
AnswerRe: Intersect in SQL Server2000 Pin
Priya_20071-Mar-07 20:29
Priya_20071-Mar-07 20:29 
QuestionHow to run script file through .net? Pin
NanaAM28-Feb-07 21:33
NanaAM28-Feb-07 21:33 
AnswerRe: How to run script file through .net? Pin
Colin Angus Mackay28-Feb-07 23:35
Colin Angus Mackay28-Feb-07 23:35 
GeneralRe: How to run script file through .net? Pin
NanaAM1-Mar-07 19:24
NanaAM1-Mar-07 19:24 
GeneralRe: How to run script file through .net? Pin
Colin Angus Mackay1-Mar-07 21:24
Colin Angus Mackay1-Mar-07 21:24 
Questionhow to get top theree salary getters from table Pin
mohd imran abdul aziz28-Feb-07 19:51
mohd imran abdul aziz28-Feb-07 19:51 
AnswerRe: how to get top theree salary getters from table Pin
sam#28-Feb-07 20:09
sam#28-Feb-07 20:09 
AnswerRe: how to get top theree salary getters from table Pin
Sylvester george2-Mar-07 0:01
Sylvester george2-Mar-07 0:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.