Viewing 15 posts - 316 through 330 (of 1,347 total)
The 2nd INSERT is happening inside a conditional IF block.
Are you certain the 2nd INSERT is actually inserting ? Have you added PRINT debugging to verify that everything inside the...
August 16, 2006 at 12:15 pm
>>a table can only have one clustered index and it should be your primary key since the records need to be unique
False.
The primary key is not always a good candidate for clustering....
August 16, 2006 at 12:11 pm
>>That's exactly what I did, but it's still taking the identity of the first insert!!!
Does the table being inserted to actually have an identity column ? Post the DDL.
August 16, 2006 at 12:06 pm
Why would you use IDENT_CURRENT() ?
Returns the last identity value generated for a specified table in any session and any scope.
So, another session on your...
August 16, 2006 at 12:04 pm
Did you read Books On Line ?
Returns the last IDENTITY value inserted into an IDENTITY column in the same scope. A scope is a module -- a stored...
August 16, 2006 at 11:57 am
T-SQL string concatenation simply uses the '+' operator.
SELECT 'A' + YourColumnName
FROM YourTableName
August 16, 2006 at 11:43 am
>>Obviously a field not used in the SELECT can't be used in the ORDER BY clause.
Put your SELECT into a Derived Table and add on 1 extra column
as a sort...
August 16, 2006 at 9:55 am
FROM MyDB2
The FROM in an UPDATE (or SELECT) expects a table name. You've given it a database name, not a table name.
You don't need a linked server. The databases are...
August 15, 2006 at 4:08 pm
Like this:
where NOT (
p.vendor_addr_l1 is null
and p.vendor_addr_l2 is null
and p.vendor_addr_l3 is null
and p.vendor_addr_l4 is null
and p.vendor_addr_l5 is null
and p.vendor_addr_l6...
August 15, 2006 at 3:48 pm
>>Is that not correct?
Nope, not correct. You've structured it as a NOT IN which creates an unnecessary sub-query.
If you've already selected FROM the required table, and simply need to filter...
August 15, 2006 at 3:46 pm
That's why the sub-query on Max() is not the correct solution. It doesn't handle customers who made 2 or more payments on the same date.
What does this do with no...
August 15, 2006 at 3:33 pm
You have included a.date_payment in the resultset.
It wasn't there in your original question. Which means you wasted effort on providing you the wrong solution.
When you put a.date_payment in the resultset,...
August 15, 2006 at 2:58 pm
SELECT *
FROM SchHtmlControl
WHERE (@optionSchHtmlControl = 1000 And SchHtmlControlID in (1,2) )
Or SchHtmlControlID = @optionSchHtmlControl
August 15, 2006 at 2:20 pm
Or another option that should perform well if column payment.CustID is the 1st column in an index:
SELECT c.custID, c.CustName
FROM customer As c
WHERE (c.CustID like '10%' or c.CustID like '20%')
AND EXISTS (
SELECT *
...
August 15, 2006 at 1:22 pm
Use native format instead of text
or
Update the data before exporting, replacing line breaks
August 15, 2006 at 12:21 pm
Viewing 15 posts - 316 through 330 (of 1,347 total)