To my knowledge SQL Server 2008 will only allow one clustered index per table. For the sake of this question let's say I have a list of user-submitted stories that contains the following columns.
ID (int, primary key)
Title (nvarchar)
Url (nvarchar)
UniqueName (nvarchar) This is the url slug (blah-blah-blah)
CategoryID (int, FK to Cate...
Hello. I have written a stupid little game and want to have some kind of leader board website.
Usually leaderboards are limited to 10 or 20 top players, but I thought it would be nice if I could record, for every player, their top score. Then, I could always display their world-wide rank.
A simple schema such as:
create table leaderbo...
Ok, i've been trying to solve this for about 2 hours now... Please advise:
Tables:
PROFILE [id (int), name (varchar), ...]
SKILL [id (int), id_profile (int), id_app (int), lvl (int), ...]
APP [id (int), ...]
The lvl can basically go from 0 to 3.
I'm trying to get this particular stat:
"What is the percentage of apps that is c...
In my Live sql database ,I have to change the date value from (date, month ,year) to date.
Now there is 100 records with the date as date,month ,year(3 Fields).iF I change directly to date Field all the datas in the 3 field of those 100 records will automaticly change to a default date and original dates will disappear.What should i do ...
Why in the ADVANCE section when I 'configure data source' is the 'GENERATE INSERT UPDATE AND SELECT STATEMENT' greyed out? On some tables it isn't greyed out and works fine.
I know that a way around this can be achieved by changing the autogenerateeditbutton tag to true in properties and you can edit this way - but when this is done t...
I am trying to insert all values of one table into another. But the insert statement accepts values, but i would like it to accept a select * from the initial_Table. Is this possible?
...
I will likely be responsible for porting a vb6 application to c#. This application is a windows app that interacts with an access db. The data access is encapsulated in basic business objects. One class for one table basically. The existing vb6 business objects read and write to the DB via DAO. I have written DALs and ORMs a few times be...
I am having some problems with linq to entities in the ado.net entity framework. Basically what I'm doing is this:
var results = (from c in companies
where c.Name.StartsWith(letter)
select c);
and this gets translated to SQL as something like:
WHERE (CAST(CHARINDEX(@p, [Extent1].[Name]) AS int)) = 1
which is fine but my table has...
I was playing with the following, but it's not there just yet.
ALTER TABLE `product_price` CHANGE `price` = `price` - 20;
...
Hi,
We have a database that contains several Trees.
These trees are build using the "Preorder tree traversal" principle. This is a very powerful way of creating trees but it has one big disadvantage, adding multiple nodes at once.
We have to create a copy function in our tree, copying a single (lowest level) node is very easy, you can...
We have a query to remove some rows from the table based on an id field (primary key). It is a pretty straightforward query:
delete all from OUR_TABLE where ID in (123, 345, ...)
The problem is no.of ids can be huge (Eg. 70k), so the query takes a long time. Is there any way to optimize this?
(We are using sybase - if that matters).
...
Hi there guys, should be simple enough but it's causing me a couple of issues.
I have a data set similar to the following:
User
UserID
Name
Age
UserPropertyValues
UserID
PropertyCodeValueID
PropertyCodes
PropertyCodeID
PropertyCodeName
PropertyCodeValues
PropertyCodeValueID
PropertyCodeID
PropertValue
Now let's...
Hi,
Im using the VS2005 Table Adapter query wizard to design my datasets. However, I cannot see any SPROCS on my sybase database when selecting ' use existing stored procedure '
In the drop down supplied by the wizard it allows me to see all the functions that are in Sybase but not the SPROCS. Im logging also as DBA purely to see if ...
I am doing some reading, and came across avoiding an internalStore if my application does not need to massage the data before being sent to SQL. What is a data massage?
...
Hello All,
I'm having trouble getting LINQ to translate something into the query I need. In T-SQL, we do a <= and >= comparison on three columns that are CHAR(6) columns. LINQ will not allow me to do this since
Operator '<=' cannot be applied to
operands of type 'string' to 'string'.
I have the following T-SQL query..
SELECT ...
Hi,
I have an SSRS report , Oracle is my backend and am using this following query for dataset of my second parameter.
select distinct X
from v_stf_sec_user_staffing_center usc
where usc.center_group_id in (
select distinct center_group_id from V_T_STAFFING_CENTER_GROUP scg
where INSTR(','||REPLACE(:PI_REGION_LIST,' ')||',', ','|...
Hello Group,
I am still fairly green in SQL, and I have a question.
I am creating a lookup using reporting services that finds an account based on lat/long. My question is how can I get results from a stored procedure to initialize variables in the following sp?
Example:
--This sp will go out and get the minlat, maxlat, minlong, maxlo...
I have two table with parent child relationship and still confuse how to map it into class from tables. Simple class which encapsulate methods and not using Business Object / Value Object. The tables are category and product.
When a webform list product from a category, what approach I should do?
Create Category object and call GetProd...
Hi,
I'm just wondering if all of the following joins are logically equivalent, and if not, why not?
SELECT t1.x, t2.y from t1, t2 where t1.a=t2.a and t1.b=t2.b and t1.c = t2.c;
SELECT t1.x, t2.y from t1 join t2 on t1.a=t2.a where t1.b=t2.b and t1.c = t2.c;
SELECT t1.x, t2.y from t1 join t2 on t1.a=t2.a and t1.b=t2.b where t1.c = t2.c...
I recently discovered that I could use the sp_help to get a table definition and have been hooked onto it since then. Before my discovery, I had to open up the Object explorer in SQL Management studio, manually search for the table name, right click on the table and select Design. That was a lot of effort!
What other system stored proce...