Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Experiencing difficulties with SQL scriptExperiencing difficulties with SQL script
Previous
 
Next
New Post
5/18/2007 2:56 AM
 
Hi,

I'm busy developing a tagging module in DNN 4.5.1 Basically it would allow users to tag a page, view and maintain their tags, and see tag clouds containning their tags, or other users tags, or most popular tags etc. you know your average de.licio.us rip-off.

The problem I'm having is with my SQL script, sql and stored procedures is not my strong point. Basically I adapted the sql script used for the Survey module. When I remove all the refferences to {databaseOwner}{objectQualifier} from the script, and run it in SQL server management studio's query analyzer, all is fine, and I get no errors. but when I run the script in DNN I get the following message. -->

System.Data.SqlClient.SqlException: Invalid column name 'TagID'. Invalid column name 'UserID'. Invalid column name 'TagDate'. Invalid column name 'TagText'. Invalid column name 'TagUrl'. Invalid column name 'TagHistory'. Invalid column name 'TagQty'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) create procedure dbo.GetTag @TagID int, @UserID int as select TagID, UserID, TagDate, TagText, TagUrl, TagHistory, TagQty


Here is the script I'm using --->


/************************************************************/
/***** SqlDataProvider *****/
/***** *****/
/***** *****/
/***** Note: To manually execute this script you must *****/
/***** perform a search and replace operation *****/
/***** for {databaseOwner} and {objectQualifier} *****/
/***** *****/
/************************************************************/

if exists (select * from dbo.sysobjects where id =
object_id(N'{databaseOwner}{objectQualifier}GetTag') and
OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure {databaseOwner}{objectQualifier}GetTag
GO
if exists (select * from dbo.sysobjects where id =
object_id(N'{databaseOwner}{objectQualifier}AddTag') and
OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure {databaseOwner}{objectQualifier}AddTag
GO
if exists (select * from dbo.sysobjects where id =
object_id(N'{databaseOwner}{objectQualifier}DeleteTag') and
OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure {databaseOwner}{objectQualifier}DeleteTag
GO
if not exists (select * from dbo.sysobjects where id =
object_id(N'{databaseOwner}{objectQualifier}JPTags') and
OBJECTPROPERTY(id, N'IsTable') = 1)
CREATE TABLE {databaseOwner}{objectQualifier}JPTags (
[TagID] [int] IDENTITY (1, 1) NOT NULL ,
[UserID] [int] NOT NULL ,
[TagDate] [datetime] NOT NULL,
[TagText] [nvarchar] (500) NULL ,
[TagUrl] [nvarchar] (500) NULL ,
[TagHistory] [int] NULL ,
[TagQty] [int] NULL ,
) ON [PRIMARY]
GO
if not exists (select * from dbo.sysobjects where id =
object_id(N'PK_{objectQualifier}JPTags') and OBJECTPROPERTY(id,
N'IsPrimaryKey') = 1)
ALTER TABLE {databaseOwner}{objectQualifier}JPTags ADD CONSTRAINT
PK_{objectQualifier}JPTags PRIMARY KEY CLUSTERED
(
TagID
) ON [PRIMARY]
GO
if not exists (select * from dbo.sysobjects where id =
object_id(N'FK_{objectQualifier}JPTags_{objectQualifier}Users') and
OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE {databaseOwner}{objectQualifier}JPTags ADD CONSTRAINT
FK_{objectQualifier}JPTags_{objectQualifier}Users FOREIGN KEY
(
UserID
) REFERENCES {databaseOwner}{objectQualifier}Users
(
UserID
) ON DELETE CASCADE
NOT FOR REPLICATION
GO
create procedure {databaseOwner}{objectQualifier}GetTag
@TagID int,
@UserID int
as
select TagID,
UserID,
TagDate,
TagText,
TagUrl,
TagHistory,
TagQty
GO
create procedure {databaseOwner}{objectQualifier}AddTag
@UserID int,
@TagDate datetime,
@TagText nvarchar(500),
@TagUrl nvarchar(500),
@TagHistory int,
@TagQty int
as
insert into {objectQualifier}JPtags (
UserID,
TagDate,
TagText,
TagUrl,
TagHistory,
TagQty
)
values (
@UserID,
@TagDate,
@TagText,
@TagUrl,
@TagHistory,
@TagQty
)
select SCOPE_IDENTITY()
GO
create procedure {databaseOwner}{objectQualifier}DeleteTag
@TagID int
as
delete
from {objectQualifier}JPTags
where TagID = @TagID
GO
/************************************************************/
/***** SqlDataProvider *****/
/************************************************************/






Please, any help would be welcome, Like I said, SQL and stored procedures is not one of my strengths, so maybe the error is really obvious.

What would happen If I created the table's manually in my db? (besides from the fact that I wont be able to package and distribute my module to the public)?

OR ALTERNATIVELY

Does anyone know about a tagging module out there? something that works simmilar to de.liscio.us?

Once again, any help would be appreciated.

Thanking you in advance

Julian
 
New Post
5/18/2007 7:11 AM
 

Looks like you are missing the FROM statement in the GetTag SP.

 
New Post
5/21/2007 2:40 AM
 
Doh! Thanks you so much! I'm such a clown sometimes :( Once again thanks, I've been staring at this for 3 days straight, and now that you pointed it out, I can kick myself!
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Experiencing difficulties with SQL scriptExperiencing difficulties with SQL script


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out