I'm creating a discussion forum for my website, using Sql Server 2000. I need to display 'Number of threads', 'Number of posts', 'Last post by' (username/id and date) for each forum, and 'Number of replies' and 'Last post by' (username/id and date) for each thread.Here are a couple of ideas I have come up with to solve this problem:1) Poll the database (using a stored procedure that returns the number I'm looking for) for each forum when I loop all the fourms. - I suspect this approach isn't optimal, since it creates more traffic to the database.2) Have fields in my Forum and ForumPost tables for 'Number of threads' and so on. Now, create triggers that updates these fields every time a post is made. - I guess this would be much more effective than the first apporach, since everything is done on the database server directly.Are there any other ways that are better? Please advice! Thanks a bunch for any help!
There is now a NEW SQL discussion Group currently being tested; http://www.baysignia.com/discussions/discussions.xml Try it out and send comments to faq@baysignia.com
CREATE TABLE [dbo].[Audit] ( [id] [int] identity (1,1) NOT NULL , [col1] [char] (10) NOT NULL , [col2] [char] (15) NOT NULL , [col3] [int] NOT NULL , [col4] [varchar] (50) NOT NULL , [col5] [datetime] NOT NULL , [col6] [varchar] (4000) NULL , [col7] [char] (3) NULL ) GO
This table grows to about 40 million rows during the course of the month. The table has a clustered index on the id field and a non clustered index on the col2 and col3. The id column is not used in queries. At the moment we run weekly dbcc reindexes on all the indexes. We are running into a space issue on the reindex of the clustered index (copying the whole table out , ordering etc) and are considering dropping the index or changing to a non clustered index. (The DBCC utility that we have built will only rebuilt all the indexes or none at all.)
I feel this is not a good idea and know my reasons. I would like some input as to why this might prove a bad idea.
Will it increase page splitting? Will the table performance be impacted even if the queries are not specifically using the clustered index?
I'm sure this has been a topic in the past. I would like to build a fact sheet about each one and do a compairison. Are there any articles/links/resources out there that speak to this issue?
OK, I`ve been researching the use of the TEXT datatype all day and would like opinions on what I`ve found.
First, a little background. I have been tasked with writing an ASP application to handle the display of FAQs for a company`s products. I would like to store all info in a table much like
faqID int question TEXT answer TEXT
Simple enough, right? I then tried to create a stored procedure to add a new FAQ and all hell broke loose. ASP would not pass anything larger than 255 chars to the stored procedure.
I read in the "ADO and SQL Server Developer`s Guide" from Microsoft about using varchar datatypes of 255 chars (instead of TEXT) and chunking large text up to fit in these smaller datatypes. This seems like a lot of work.
I also read in "Inside SQL Server 6.5" that "The text datatype is sometimes awkward to work with. Many functions don`t operate against text, stored procedures are limited in what they can do with text, and some tools don`t deal with it well." (page 632). This statement concerns me greatly. How are stored procedures limited in dealing with TEXT? Do the standard SQL UPDATE and INSERT commands work or must READTEXT and UPDATETEXT be used instead?
I guess my question is, what is the best way to accomplish this? I have a feeling that others have had to do this before. Is SQL Server not meant to handle large textual objects? Is chunking the best way to go? Will version 7.0 handle this scenario better?
I would like to hear your thoughts on a philosophy I adhere to.
As a rule of thumb I've always preached that Unique Indexes are for linking tables and Primary Keys are used to ensure that records aren't duplicated. I’ve embraced this philosophy for a couple reasons, the main one being that I don’t have to create numerous foreign key fields in the foreign key table.
However I’ve done most of my programming in Access and am now in need of something more robust (SQL Server v7) and I’m wondering if I need to reconsider.
I do also have a how to question; that being is it possible to create a table join on a unique index in SQL Server v7 and if so how? I would like to have an Auto Number / Auto Incremented / Unique Identifier field in the Primary Key table that links to a numeric field in the Foreign Key table.
I have been doing relational database forever(or a long time) and have been intruduces to a team that uses a highly normalized database(propietary) to manage workflow.
We are capturing data in an AUDIT Trail EAV format.(500 million rows)
It is my task to build this into a data warehouse for reporting and I need to have with my team a relational database discussion. The relational database knowledge on this team is DB2 based, IDMS, and other past evolutions.
The common processes used are recieve a flat file and process this file sequentially using C# or VB doing lookups of other databse tables and writing out another flat file to be converted in XML for load to the propritary system.
My goal is to attempt to introduce new design concepts to my team and these are some talking points that I have come up with for a lunch and learn session.
can anyone else add to this list I don't want to get into a deep discussion about 3rd NF, Star Schemas vs Snowflake, etc.. I want to keep is informational and light to eliceit discussion and relat it back to older technologies.
some of the topics we can discuss are: Why the data warehouse Real-time tables what needs to stay in prod What is going to happen to reporting database Interaction between database on the same cluster/server Interaction between databases on different servers (linked servers not allowed) Set processing as opposed to cursor processing. Table types EAV Type1 Type2 Fact Dimensions Code
I'm a DB teacher in a University. Planning and developing SQL exercises for my students I found a "tricky" or extrange sql exercise.
The sql exercise using Northwind DB reads as follows: "Wich is the total amount of the freight that corresponds to all orders containing products of seafood category ?"
The first sql code that comes to my mind was:
select sum(freight) from orders o, "order details" d, products p, categories c where o.orderid=d.orderid and d.productid=p.productid and p.categoryid=c.categoryid and categoryname='seafood'
This is equivalent code constructed with Query constructor in Enterprise Manager: SELECT SUM(dbo.Orders.Freight) AS Expr1 FROM dbo.Orders INNER JOIN dbo.[Order Details] ON dbo.Orders.OrderID = dbo.[Order Details].OrderID INNER JOIN dbo.Products ON dbo.[Order Details].ProductID = dbo.Products.ProductID INNER JOIN dbo.Categories ON dbo.Products.CategoryID = dbo.Categories.CategoryID WHERE (dbo.Categories.CategoryName = N'seafood')
These 2 equivalent queries output 27722.9600 as result, but the correct result (total freight) is 23791.1400.
Did you also think (as I did) that the exposed code is correct?
Now I know the correct sql code that gives the corect answer and also the explanation why the code exposed fails, but before share it under your posible request, want to know your tech comments about this exercise in order to know if this particular exercise is "tricky" (make people to fail) or is my total fault and need to review my strategies of applying/constructing sql (and teaching).
I am about to prepare a paper concerning the field of real-time data mining. Real-time here means the process of incremental training of an existing model as soon as the data arrives.
There is a number of papers introducing algorithms for incremental association analysis, incremental clustering etc. Stream mining Ãs a field which is closely related to that. The main reason for the implementation of incremental algorithms is a) the large amount of data to be mined and b) the high rate of new data that is evolving every day.
Using classical batch mining algorithms, models that are outdated for some reason, would have to be re-trained, which could be very time consuming for billions of records. And once the training is completed, the training would have to be restarted once again because a bulk of new data has been arrived.
The question that I would like to discuss now is: For what real world applications would it be a meaningful or even essential to use real-time training of models?
Two main reasons could determine the answer to that question:
You just want to incorporate new data into existing models in order to increase the prediction accuracy of your model or Your underlying data is subject to more or less massive changes (also refered to as concept drift) and you want to adapt your mining model continuously to that reality.
I'm looking for some examples or ideas where one of these cases apply and it would be a good idea to have incremental mining algorithms involved.
I'm looking forward to inspiring some discussion on that issue.
Our company plans to redesign the forum. we currently stores all posts in text files. someone suggest that we can use xml. I am not familiar with using xml. Is XML better for the forum design and data retriving?
Can anyone tell me , For instance : if someone has posted new post and If I want to answer to that post, how can I answer that. Or How do I know that there is some new post which people can response to it, please give me your feed back on this
Where is the list for forums, When i started to write for Sqlserver, i never searched or looked for forum. Same did when i was working with the c#. Now I have to find the correct forum. So where is the list of those forums, thanks.
I have had countless email alerts thru today alerting me to people replying to threads I have commented on. And I can see the person's comments.
1) WhenI click on the link it takes me to a page saying the post doesn't exist
2) When I try and browse to the thread manually I can't see the reply.
3) On one occasion I replied to one of these threads asking if someone had posted something and then deleted it. After I submitted the post I could see all the other posts in the thread which were supposedly missing before. The next time I browse to the thread (in a new browser window) I can't see any of the posts.
BROKEN!!!! I for one won't be coming back here until they fix it. Its pathetic.
I have posted something on the bug report forum by the way.
Our website provide users with a forum where they can enter messages. So, typically, a user would enter a message, click submit, and their message would be displayed on the forum.
The db that stores these msgs uses a varchar field. Now, we're adding a facility to convert any urls that are entered to links by adding 'a href' tags, so that when users see messages with urls, those urls appear as links, and they can click on them. The problem is that if a user enters a message of 8K chars, then we add 'a href' tags to any urls they have, that makes the message length > 8K, preventing us from storing it in our db. (Please note that we do need to add HTML tags for other reasons as well, not just to convert urls to links.)
We thought about adding 'a href' tags during pre-render, thus avoiding storing html in the db, but found that doing such string manipulations, while a user is waiting to see their post displayed on the forum, was expensive. Timing tests revealed that the time to render such pages more than doubled.
I have solved such problems previously by adding an extra field in the db to store any overflow data, that is, data that appears after the first 8K chars.
However, I learnt of sql server 2005's varchar(max) datatype, and 'am wondering if the best way to solve this problem would be to replace the varchar field with varchar(max).
i have a main pallet inventory table, kinda like: key location sku qty datercvd1 W9A03 12345 500 5/5/072 W9A04 12345 500 5/5/073 W9A05 12345 500 5/5/07 Now, if i say:Select loc,sku,qty,datercvdFrom TableWhere sku=12345 it works great, now say my order only requiers 700 of that sku,I only want to pull pallets that i need, how can i say:Select loc,sku,qty,datercvdFrom TableWhere sku=12345 (that qty summed is not more than 700?) not sure if i can or how to make it like a formula. Thanks in advance. Jeff
I have got MSSQL 2000 set up on a machine in my rack at my local telehouse, and a web server set up at home on an ADSL line.
Both servers can see (ping) eachother fine , so you can rule out any kind of connectivity issues straight away, but when i try to get my forum to connect to the mssql database using the correct credentials it just fails saying that the credentials are incorrect ot the server does not exist.
I also installed an SQL database tool on my web server (Shusheng SQL Tool) and attempted to connect to my SQL server using that tool, and got the following message: '[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.'
The server is currently using mixed mode authentication (SQL/Windows) and has both TCP/IP and Named pipes enabled.
Is there some kind of 'Enable remote connections' option in SQL? I need to be able to allow connections to my SQL server from any system, anywhere...
I'm just about to launch a forum, and right now its built in ASP classic with an Access db. I origianlly used Access because most hosts charge extra for MS-SQL server. Recently I switched to Jodohost who offers Access, MS-SQL and MySql for at no additional cost. So now that I have the option, I would like to pick the best solution before I launch.
* My questions are...
- What is the best db solution to go with for a currently small forum?
- How problematic do you think a data migration would be in the future if I stayed with Access for now and upgraded to MS-SQL with a full forum?
- Is it just smarter to go with MS-SQL now, with an empty forum, regardless of any preformance issues because potential migration problems are a greater risk?
- At what point does the speed of MS-SQL at high volumes over come the potential lags in accessing MS-SQL if it is hosted on a different machine from the one hosting the webpages?
* And please keep in mind...
- I have no db training. I can muddle through Access well enough, but administrating MS-SQL I think might be another story
- This fourm will start off very small, but could grow to be quite large
- I may not stay with jodohost, and would therefore likely have to pay more for MS-SQL (which I woudl rather not do)
I have been helped greatly by people in this forum for SQL7, but I have some questions about 2000. Is this a place where 2000 is being discussed at all? If not I would appreciate someone pointing me in the right direction.
i am building a forum in asp (just for fun). i have a mssql 2005 server, and i want to mergeimport data from another mssql 2000 server. but i dont know how to do it correctly.
i have some tables like this [forum_c] forum_c_id (PK, int, not null) forum_c_name (varchar, not null)
[forum_sc] forum_sc_id (PK, int, not null) forum_sc_cid (int, not null) forum_sc_name (varchar, not null)
etc...
forum_c meaning "forum categories", and forum_sc "forum sub categories". forum_sc_cid has the value of forum_c_id to know to what categorie it belongs to.
but i dont know how to import it and keep the correct id's. can somebody please tell me what i need to do???
When running practically any report in FRx (we use it to generate reports in Solomon) we are getting the following error:
FRx Reporting Engine:
01000: [Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated.
This just recently started happening. Is anyone familiar with this? It doesnt give much information after that, it just will not generate the report after the message pops up.
SQLTeam.com SQLSERVERCENTRAL.com TekTips.com MSDNSQL Forum forums.sqlmag.com
I hate to ask for information such as this but with the low response to my questions I was wondering anyone knows of a better site for SQL Server database mail issues?
Just lately I have noticed that I am periodically getting signed out of this forum. When I try and sign back in I get directed to an error page saying:
We apologize, but an unknown error has occured in the forums.
This error has been logged.
I would say this has been happening for a couple of weeks now at least.