Viewing 15 posts - 2,221 through 2,235 (of 3,008 total)
When you use the POWER function, you will get better results if you cast all the parameters to float. If needed, round the result.
select
MyNum,
CubeRootNumeric= power(1.0*MyNum,1.0/3),
CubeRootFloat= power(convert(float,MyNum),1E/3E)
from
(-- Test Data
selectMyNum =...
August 22, 2008 at 9:55 am
DBADave (8/21/2008)
August 22, 2008 at 7:27 am
declare @x1 varchar(20), @x2 varchar(20)
select @x1 = 'a', @x2 = 'A'
if @x1 collate SQL_Latin1_General_CP850_BIN = @x2
print 'Equal 1' else print 'Not equal 1'
if @x1 collate SQL_Latin1_General_CP1_CI_AS = @x2
print 'Equal 2'...
August 21, 2008 at 10:55 pm
Short? You guys need to try harder. :satisfied:
select
NewNum = right(1000000+MyNum,6)
from
( --Test Data
select MyNum=1union all
select 10union all
select 100union all
select 1000union all
select 10000union all
select 100000union all
select 999999 ) a
Results:
NewNum
------
000001
000010
000100
001000
010000
100000
999999
August 21, 2008 at 7:16 pm
Access to the database can continue as normal.
August 21, 2008 at 5:03 pm
jerrym (8/20/2008)
Hi Grasshopperadding the extra Begin causes an error.
any other suggestions? anyone?
regards
jerry
Yes, you need to re-write the trigger completely to be able to handle multi-row updates.
Better yet, get rid of...
August 20, 2008 at 5:03 pm
That really is a stupid question, but not very interesting.
As for the answer, you can just run the code yourself to get that.
August 19, 2008 at 9:58 pm
greg (8/19/2008)
Just a few follow-on comments.
I initially had CompaniesID in the EarningsMiscWrk record, but then...
August 19, 2008 at 3:59 pm
Add an additional unique constraint to the other tables with (tablenameID, CompanyID), then add CompanyId to table EarningsMiscWrk, and then create the FK references to be (tablenameID, CompanyID), instead of...
August 19, 2008 at 12:26 pm
The F_UNIX_TIME_TO_DATETIME function on the link below will do what you want.
UNIX Time Conversion Functions
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=66858
The code is simple, so you can also do it this way:
select
dateadd(ss,a.TIME_IN_SECONDS,25567)
from
MyTable a
August 18, 2008 at 1:28 pm
If both columns are datetimes containing only dates (time part = 00:00:00.000), then this will do it.
where O.Delivery_Date-O.Date_Order_Placed >= convert(datetime,'19000102')
August 18, 2008 at 1:20 pm
The only way to defragment a heap table is to create a clustered index.
You can create a clustered index and then drop it if there is some reason you don’t...
August 18, 2008 at 12:27 pm
There are a small number of expert database designers who are capable of understanding the significant disadvantages and trade-offs of a denormalized design and using it in selected cases where...
August 15, 2008 at 2:56 pm
You can use this script with any version of SQL from 7.0 up.
Script to analyze table space usage
August 15, 2008 at 1:23 pm
Most of the applications that I see that make heavy use of cursors were either ported from Oracle to SQL Server or created by developers who only had Oracle experience.
We...
August 15, 2008 at 8:31 am
Viewing 15 posts - 2,221 through 2,235 (of 3,008 total)