I am using a wordpress plugin called “GD Star Rating” to allow my users to vote on stories that I post to one of my websites. http://everydayfiction.com/ Recently we have been having a lot of abuse of the system. Stories that have obviously been voted up artificially. “GD Star Rating” creates some detailed logs when a user votes on a
Clustered index – multi-part vs single-part index and effects of inserts/deletes
This question is about what happens with the reorganizing of data in a clustered index when an insert is done. I assume that it should be more expensive to do inserts on a table which has a clustered …
Public SQL database for educational purposes
I am looking for a publicly available SQL database with free access, where one can run some SELECT queries for free on some meaningful data (not item1, item2, item3). Have you seen any? Even better if …
(Oracle) How get total number of results when using a pagination query?
I am using Oracle 10g and the following paradigm to get a page of 15 results as a time (so that when the user is looking at page 2 of a search result, they see records 16-30). select * from ( …
TSQL – How to URL Encode
Looking for a bug free tested sql script that i could use in a UDF to encode a url through sql. Function would take in a URL and pass out a URL Encoded URL. I have seen a few, but all i have come …
SQL Server Native Client API examples
I am writing a C++ application that needs to execute SQL queries in a SQL Server DB and I want to do it using SQL Server Native Client. The MSDN documentation has no a full reference on it and has a few examples so I am looking for some site having more information on how to connect, execute queries and
Join one row to multiple rows in another table
I have a table to entities (lets call them people) and properties (one person can have an arbitrary number of properties). Ex: People Properties I would like to write an efficient select that would select people based on age and return all or some of their properties. It’s also acceptable to return one of the properties and total property count.
Simple check for SELECT query empty result
Can anyone point out how to check if a select query returns non empty result set? For example I have next query: Should I do something like next: to test if result set is not empty? Answer Use @@ROWCOUNT: According to SQL Server Books Online: Returns the number of rows affected by the last statement. If the number of rows
When should I use primary key or index?
When should I use a primary key or an index? What are their differences and which is the best?
What is Service Broker in SQL Server?
What is Service Broker in SQL Server and is it meaningful to enable it in a simple database, not in a distributed database? Answer SQL Service Broker is an extension mechanism that allows you to queue events for asynchronous processing. There is no intrinsic harm in enabling the broker. If it’s not used, it will just be idle. It works