Viewing 15 posts - 4,981 through 4,995 (of 6,036 total)
IF Object_Id('tempdb..##TempTable') IS NOT NULL
DROP TABLE ##TempTable
_____________
Code for TallyGenerator
October 5, 2006 at 5:17 pm
Check out OPENDATASOURCE in BOL.
_____________
Code for TallyGenerator
October 5, 2006 at 5:07 pm
Do you create a table every day?
Sure you need separate table for each day data?
If yes, you better stay with Excel.
In SQL Server you need 1 table with "Date" column. Having...
_____________
Code for TallyGenerator
October 5, 2006 at 5:01 pm
I wanna see the query which actually returns you count(*) = null.
I was always sure it's not possible.
_____________
Code for TallyGenerator
October 4, 2006 at 5:21 pm
It's your application issue.
Quite typical issue.
Remove duplicated roudtrip to database for saving data.
You may check that double call takes place using SQL Profiler.
_____________
Code for TallyGenerator
October 4, 2006 at 3:20 pm
1) Don't ever pass @Criteria parameter.
Have you ever heard about SQL injections?
2) Use WHERE (State = @State OR @State IS NULL)
3) What is the connection between main query and...
_____________
Code for TallyGenerator
October 3, 2006 at 3:09 pm
Option d) is missing:
Use a subquery.
Option e):
use output parameter and assign @@rowcount to it
_____________
Code for TallyGenerator
October 3, 2006 at 2:02 pm
You did not read it carefully.
Read again. There is an answer on your question over there.
And again. DON'T USE CURSORS.
I don't see any reason why you need that @var if...
_____________
Code for TallyGenerator
October 2, 2006 at 11:43 pm
Why are you asking me?
BOL is on you desk, just press F1.
Find SELECT in index, then choose SELECT @local_variable.
I would not explain better.
BTW, don't use cursors. Think.
_____________
Code for TallyGenerator
October 2, 2006 at 11:26 pm
Did you read anything about index on BIT column?
It does not work by definition.
It's strong recommendation in any book - don't create index on bit column.
You don't need to believe me...
_____________
Code for TallyGenerator
October 2, 2006 at 11:04 pm
select T1.Session_ID, T1.Session_Name, T1.IPAddress,
COALESCE(T2.SystemUser_ID, T3. Buyer_ID, T4.Supplier_ID) as PartyID,
COALESCE(T2.User_Name, T3.BuyerName, T4.Supplier_Name) as PartyName
FROM Table1 T1
LEFT JOIN Table2 T2 ON T1.SystemUser_ID = T2.SystemUser_ID AND T1.LogUserType_ID = 1
LEFT JOIN Table3 T3 ON T1.Buyer_ID =...
_____________
Code for TallyGenerator
October 2, 2006 at 10:53 pm
If [Datedispensed] is a date why datatype is [nvarchar](max) ?
You know, mita, conversion of 2 million values takes some time. And...
_____________
Code for TallyGenerator
October 2, 2006 at 8:45 pm
There is no any test data we can see.
But anyway you must read "CAST and CONVERT" topic in BOL at least 10 times before you start to do any conversions...
_____________
Code for TallyGenerator
October 2, 2006 at 7:37 pm
Which SARGABLE solution have you found over there?
_____________
Code for TallyGenerator
October 2, 2006 at 6:26 pm
Are you sure your dateField is datetime???
Implicit conversion of datetime to smalldatetime used to be my "favourite exercise"
some time ago.
And converting...
_____________
Code for TallyGenerator
October 2, 2006 at 6:17 pm
Viewing 15 posts - 4,981 through 4,995 (of 6,036 total)