Forum Replies Created

Viewing 15 posts - 6,031 through 6,045 (of 6,486 total)

  • RE: Setting a Derived Column to a Random Value

    use TSQL to do it. there's a RAND() function.

    Syntax would be something like:

    update tablename

    set randomfield=RAND(primarykey)*20000000000 -- RAND() will return a number between 0 and 1

    cast it to integer if...

  • RE: Adding workdays

    Greg -

    I think you need to try the solution I posted. The reverse engineering you did has some logic flaws. In particular - you're going to start "losing"...

  • RE: Auto Column Check

    Computed column formula would be

    case when datediff(dd,datedue,isnull(datesubmit,0))>0 then datediff(dd,datedue,isnull(datesubmit,0)) else 0 end *fineperday

    DateDue and fineperday are assumed not ever to be null.

  • RE: how to remove numbers from strings?

    WEll - since we're now throwing in 2005 - this would be the perfect time to create your dbo.RegexReplace CLR function, as so:

    Imports System

    Imports System.Data

    Imports System.Data.SqlClient

    Imports System.Data.SqlTypes

    Imports Microsoft.SqlServer.Server

    Imports System.Text.RegularExpressions

    Partial Public...

  • RE: Data file size of 20 GB or more

    I'd tend to say you don't stand to gain any performance that way, since stripes are always spread across all drives. It's more likely that you would lose performance,...

  • RE: Adding workdays

    Try this one on:

    --set up

    declare @dateStart datetime

    declare @daysToAdd int

    declare @dateEnd datetime

    declare @baseday datetime

    select @datestart='9/1/2007',@daysToAdd=52

    --start by making sure your start day IS a business day

    Select @datestart=dateadd(dd,case when cast(cast(@datestart as datetime) as...

  • RE: convert ineteger to datetime

    Here's one that should do it:

    dateadd(ss,avg(convert(float(53),dateadd(dd,datediff(dd,datetimetoavg,0),datetimetoavg)))*24*60*60,0)

  • RE: Disk performance issues - Best candidates for a move?

    Well - the RAID-5 penalty applies to any write operation. A bulk loading operation/ massive update/big report/anything requiring lots of tempDB space would also incur the penalty. You may...

  • RE: Using TSQL variables in For Loop expression

    At the risk of sounding trite - why don't you just call the SP from within SSIS? Is there something you're trying to get away from?

  • RE: SELECT current address

    or - change the problem around. Put a trigger on insert to "deactivate" all addresses with same studentID, but lower historyID's. At that point you can just look...

  • RE: The College Experience

    I tried to go for a bachelor's in brewery science, but couldn't get past the practicals/tasting work:D

  • RE: Date encrytion

    Then use the procedure ID concept. Make a serial number uniquely identifying all procedures, and put THAT on the form. Anything "decryptable" without some machine process isn't worth...

  • RE: Date encrytion

    No function - it came directly from a table we maintained. Each time one of those situations occurred, the previous episode was "closed" and the the new one opened....

  • RE: Aggregate fun

    If you can live with showing the low end and high end without putting the word "to" between them try something like this

    declare @lowend int

    declare @highend int

    select @lowend=0, @highend=75

    select @lowend...

  • RE: An Hour in Time

    That's one of those times where MS ought to consider "stealing" a concept from Novell (it's not like they haven't done it before ;)). NetWare 4.1 had a concept...

Viewing 15 posts - 6,031 through 6,045 (of 6,486 total)