Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Programming Practices

Author  Topic 

PrabhatM
Starting Member

6 Posts

Posted - 2010-09-07 : 02:35:01
Hi,

I am using CF 8 and MSSQL SERVER 2005 for a web app.

I am trying to store Date, time, HTTP REF, Query String of every click that comes to my site by using delimiters in NCHARVAR(MAX) field.

I retrieve the old Click Details from DB, assign a Variable, add new Click details and store back in the NCHARVAR(MAX) field of MSSQL DB.

I have 2 issues :

1) I realise that in less than a fortnight the String size has grown to more than 32K characters and I am not able to retrieve / store more data through this string operation.

I am told usually hosting agencies limit this database string transfer to 32k.

What is the solution ?

2) Is it a good programming practice to store the User behaviour details in a "long text string file" inside a NVARCHAR(MAX) field instead of independent records?


I need to store the click details of every user as it's linked to revenue and need details for any legal disputes in future.

How best can I achieve this ? How can I store all the Click details successfully without running into character limit or memory/performance issue?

Regards

Prabhat

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2010-09-07 : 06:26:09
2) No, this is terrible. Save each click as a new row in the table instead.

And while you're at it, you should read up on some database design fundamentals and normalizing data. What you're doing is *terrible*

- Lumbago

My blog (yes, I have a blog now! just not that much content yet)
-> www.thefirstsql.com
Go to Top of Page

PrabhatM
Starting Member

6 Posts

Posted - 2010-09-07 : 10:23:47
Thank you for your forthrightness and fine advice.
Go to Top of Page
   

- Advertisement -