I am getting following error in my SQL server 2008 R2 database: Cannot use a CONTAINS or FREETEXT predicate on table or indexed view ‘tblArmy’ because it is not full-text indexed.
Tag: sql
What does the following Oracle error mean: invalid column index
I got the following error while testing some code: SQLException: Invalid column index What exactly does that mean? Is there an online document explaining what all the Oracle error codes and statements? Answer If that’s a SQLException thrown by Java, it’s most likely because you are trying to get o…
Fastest Way of Inserting in Entity Framework
I’m looking for the fastest way of inserting into Entity Framework. I’m asking this because of the scenario where you have an active TransactionScope and the insertion is huge (4000+). It can potentially last more than 10 minutes (default timeout of transactions), and this will lead to an incomple…
Hamming weight/population count in T-SQL
I’m looking for a fast way to calculate the hamming weight/population count/”the number of 1 bits” of a BINARY(1024) field. MySQL has a BIT_COUNT function that does something like that. I couldn’t find a similar function in T-SQL? Or would you suggest storing the binary data in a field…
SQL Server Compact Edition ISNULL(sth, ‘ ‘) returns a boolean value?
I have an Accounts table with columns name, password and email. They are all type nvarchar. I wrote a query like SELECT name, password, ISNULL(email, ‘eeee’) FROM Accounts WHERE name = ‘” + …
How to find which columns don’t have any data (all values are NULL)?
I have several tables in a database. I would like to find which columns (in which tables) don’t have any values (all NULL in a column). I the example below, the result should be I don’t have any idea how to create this kind of query. Your help is most appreciated! Answer For a single column, count…
sql exception : The statement has been terminated
I’m running this SQL statement and I’m getting help,please Answer A string you are trying to insert is longer than the max nr of charachters. E.g. like a string with 4001 charachters in a varchar(4000) datatype.
Generate class from database table
How can I generate a class from a SQL Server table object? I’m not talking about using some ORM. I just need to create the entities (simple class). Something like: Given some table like: Answer Set @TableName to the name of your table.
SQL WHERE ID IN (id1, id2, …, idn)
I need to write a query to retrieve a big list of ids. We do support many backends (MySQL, Firebird, SQLServer, Oracle, PostgreSQL …) so I need to write a standard SQL. The size of the id set could be big, the query would be generated programmatically. So, what is the best approach? 1) Writing a query u…
How to create an Access crosstab query with totals for the columns AND the rows?
I want my query result to look like this: Person1 Person2 Person3 Person4 Total Status1 2 4 7 3 16 Status2 0 1 0 3 4 …