SELECT * FROM TableA
INNER JOIN TableB
ON TableA.name = TableB.name
SELECT * FROM TableA, TableB
where TableA.name = TableB.name
Which is the preferred way and why?
Will there be any performance difference when keywords like JOIN is used?
Thanks
...
Hi all,
I have a class which provides generic access to LINQ to SQL entities, for example:
class LinqProvider<T> //where T is a L2S entity class
{
DataContext context;
public virtual IEnumerable<T> GetAll()
{
return context.GetTable<T>();
}
public virtual T Single(Func<T, bool> condition)
{
ret...
I'm trying to use SQL Server 2005's Full-Text Search to find single forward-slash characters within my indexed column, without success.
Can anyone tell me if this is possible at all? Example:
In my CentralSearchCache table, the SearchData column contains a row with the text "This/string/contains/forward/slashes".
This query:
SELECT ...
Assume i have a custom Windows application written in C#. This application has only the following functionalists, add, edit, delete and view. For example, a user can add a sale, change sales record, delete a sale record or view the whole sales record.
I need to add some reporting functionalists e.g. i want a user to print the sales of a...
I have to modify SQL Server reports. It is not easy to modify directly XML report file (*.rdl). Is there any IDE for editing SQL Server Reports?
...
I'm using SQL Server 2008 and I have a table with three columns: Length, StartTime and EndTime. I want to make a CHECK constraint on this table which says that:
if Length == NULL then
StartTime <> NULL and EndTime <> NULL
else
StartTime == NULL and EndTime == NULL
I've begun to try things like this:
Length == NULL AND StartTime <...
Can anyonen help with Teradata?
I want to create a query that is a standard
select count(*)
from Table
where Column = Something
but has a group by time period done by 5 minute time intervals the time column is in 'Time' format
any idea?
...
I am doing a query that converts rows to columns similar to this post but have encountered a performance problem. Here is the query:-
SELECT
Info.Customer,
Answers.Answer,
Answers.AnswerDescription,
Details.Code1,
Details.Code2,
Details.Code3
FROM
Info
LEFT OUTER JOIN Answers
ON Info.AnswerID = Answer...
Once i run this query, getting the following error. please help.
select
OrderDetails.Sku,orderdetails.mf_item_number,orderdetails.Qty,orderdetails.Price,Supplier.SupplierId,
Supplier.SupplierName,Supplier.DropShipFees,
cost = (Select Supplier_Item.Price
from
Supplier_Item,orderdetails,Supplier
where
Supplier_Item.SKU=OrderDeta...
Can anyone give me a hand improving the performance of this cursor logic from SQL 2000. It runs great in SQl2005 and SQL2008, but takes at least 20 minutes to run in SQL 2000. BTW, I would never choose to use a cursor, and I didn't write this code, just trying to get it to run faster. Upgrading this client to 2005/2008 is not an option i...
Please tell me if there's an easy way to convert a DataTable to a HashTable or a SQLDataReader to a HashTable. I have to parse it through javascriptserializer. the code i m using, having some problem. please take a look and guide me.
try
{
using (SqlConnection conn = new SqlConnection(ConnectionString))
{
using (SqlComma...
Hi All
I've got a table which contains sensitive data and according to data protection policy we have to keep a record of every read/write of the data including a row identifier and the user who accessed the table. The writing is no issue using triggers but triggers aren't supported for SELECT statements.
What's the best method of doin...
Cursor cursor = db.rawQuery("SELECT COUNT(rat)
FROM "+ TABLE_NAME_EXTRA +" apkid=\""+apkid, null);
cursor.moveToFirst();
int somatotal = cursor.getInt(0);
I'm trying to do a SQL function like count and sum, but this code returns a exception saying "emptyvalues".
anyone know why?
...
Hey Guys, having an issue with Linq-to-SQL, I am basically doing the following but it is saying it is "UserProfile does not contain definition for Username" in the current context where I wrote "u.Username" but it does exist I have added UserProfile table to MyDbml.dbml and if I connect to another table it works fine.
TiamoDataContext c...
I have a varchar(1000) column declared as field that contains all numbers, as shown below.
And I want to execute the following script. I need this to work please
Declare @PostalCode varchar(1000)=0
set @PostalCode ='7005036,7004168,7002314,7001188,6998955'
Select hl.* From CountryLocation cl
INNER JOIN refPostalCodes pc ON pc.Pos...
I want to create a new column in a MYSQL table that has Fn Ln instead of Ln, Fn. Most of my data is printed Fn Ln.
Another idea is to incorporate a string function each time there is an output (php based) but that seems to waste resources. Finally, I couldn't find the syntax (loop or foreach) for my php function anyway.
Here is the...
I'm working on creating a SQL query that will pull records from a table based on the value of two aggregate functions. These aggregate functions are pulling data from the same table, but with different filter conditions. The problem that I run into is that the results of the SUMs are much larger than if I only include one SUM function....
I've got a query that returns a proper result set, using SQL 2005. It is as follows:
select
case
when convert(varchar(4),datepart(yyyy,bug.datecreated),101)+ ' Q' +convert(varchar(2),datepart(qq,bug.datecreated),101) = '1969 Q4' then '2009 Q2'
else convert(varchar(4),datepart(yyyy,bug.datecreated),101)+ ' Q' +convert(varc...
In mysql, you can insert multiple rows to a table in one query for n > 0:
INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9), ..., (n-2, n-1, n);
Is there a way to achieve the above with Django queryset methods? Here's an example:
values = [(1, 2, 3), (4, 5, 6), ...]
for value in values:
SomeModel.objects.create(first=v...
We have an interesting problem that I was hoping someone could help to shed some light on. At a high level the problem is as below:
The following query executes quickly (1 second):
SELECT SA.*
FROM cg.SEARCHSERVER_ACTYS AS SA
JOIN CONTAINSTABLE(CG.SEARCHSERVER_ACTYS, NOTE, 'reports') AS T1 ON T1.[Key]=SA.UNIQUE_ID
but if we add a fil...