Viewing 15 posts - 61 through 75 (of 95 total)
first
EXISTS (SELECT * FROM tablename WITH (NOLOCK) where day = @day)
this just allows for dirty reads as a select statement won't interfere with other select statements.
second
here's the extremes of what...
July 7, 2008 at 3:28 pm
the DB doesn't actually 'store' the data like dd/mm/year. Usually it's a 32/64bit integer based from some starting date counting x units of time forward. It's possible that when you...
July 7, 2008 at 3:08 pm
...I wonder what advantage you see in using "Sum(1)" rather than "Count(*)" in your query. Is there any performance benefit?
I just ran
declare @date datetime
declare @date2 datetime
set @date...
July 7, 2008 at 1:35 pm
Are you sure that rs.getString(i) on the guid column is causing it? I guess I mean, is there another layer of abstraction between you and the DB where it may...
July 7, 2008 at 1:17 pm
something like this?
table t(accountid, active, [datetime])
select *
from t
where accountid = 1010100
and datetime between startdate and dateadd(ms, 86399997, enddate)
order by [datetime]
this would return all active/inactive events during a date range...
June 30, 2008 at 2:27 pm
How can I do the calculations? And please give me the format, just don't say convert.
FYI, google treats me well for this kind of stuff. eg. If I went...
June 30, 2008 at 1:16 pm
would something like this work?
select * from Table2 as b
where (b.datefield) <= convert(datetime, convert(varchar,getdate(),101) + ' 23:59:59.997'))
as it wouldn't be running a...
June 20, 2008 at 8:02 am
[...I want it to tell me that person p0000001234 gave at least $1000 by 10/1/2007. That's when they would be eligible for a particular donor award. Thank you so much...
June 19, 2008 at 1:02 pm
We have a depricated product that had entries on it's table. The customer had users tied to the table. When reavtivating the customer (they were using our product 5 years...
June 16, 2008 at 10:25 am
what is a 'visits_id'? It seems that the 'distinct' is what's hosing the computation. checking for duplicates accress 1mil rows is a lot of checking. Is that what the hash...
June 16, 2008 at 8:08 am
no one was saying anything, so I replied 😛
Somewhere on this site is a nice Article on 'Must have Rules' for DBs, which includes pk/fk...
June 10, 2008 at 9:28 am
It sounds about right
Table1(
pkid
fkTable2ID
fkTable3ID
)
or simular to that. I've seen tables with table1.id table1.schoolid table1.number table1.entityid
i mean, wtf... really. Turned out that id was the true id, but schoolid could stay...
June 10, 2008 at 8:25 am
From what I understand, numeric is calculated as base 10, so it's emulated. bigint/int are actual native binary value types. Simular to the difference between a string and a char.
make...
June 10, 2008 at 8:02 am
when you do a (select * into #table), doesn't it lock the tempdb the entire time of the select staments because the tempdb is locked during the creation of a...
May 30, 2008 at 8:49 am
I had some simple issue with converting newid() to a varchar. This could work
select convert(bigint,HashBytes('SHA1', convert(varchar(255), newid())))
and if you're paranoid
select convert(bigint,HashBytes('SHA1', convert(varchar(255), newid())+convert(varchar, getdate(),121) ))
May 29, 2008 at 12:14 pm
Viewing 15 posts - 61 through 75 (of 95 total)