Forum Replies Created

Viewing 15 posts - 13,036 through 13,050 (of 13,445 total)

  • RE: Multiple Instance Connection Question

    The name that goes in your connection string is SOMEMACHINNAME\INSTANCENAME;

    I would ask this first: why must you create an additional instance, instead of using the default instance on the...

  • RE: Insert into Table with Identity Column in Trigger

    I think we need to see the table definitions; it looks to me like you have separate tables for ID, name and address;

    at the very least the ID and NAME...

  • RE: Find and replace

    very simple:

    update some_table set somecolumn=replace(somecolumn,'.txt','.csv')

  • RE: Need some help with a select statement

    you want to use the datediff function for this:

    SELECT DATEDIFF(day, somedatecolumn, getdate()) AS no_of_days from sometable

     

    SELECT * from sometable where DATEDIFF(day, somedatecolumn, getdate()) =3 --exactly 3 days old

    SELECT * from...

  • RE: searching for value in the database

     monster searches like this are bad, but sometimes you gotta do it:

    I made an ugly server intensive cursor for a similar question a while back;noone came up with a...

  • RE: script all stored procedures into one file

    you would not need to increase the size of the isql variable; that is just containing the command "sp_helptext your_long_procedure_name" ; i think the max size it could ever be...

  • RE: select UNION

    ahh;

    the subquery in the parenthesis needs an alias:

    this fails: select name from (select name,id from sysobjects union select name,id from syscolumns)

    this works:select name from (select name,id from sysobjects union...

  • RE: select UNION

    because of the sum function, you have to GROUP BY in the outer select: try this syntax:

    select sum(col1),col2 from

    (select col1,col2 from table1 union select col1,col2 from table2)

    GROUP BY COL2

  • RE: Wildcard Searches

    your syntax is incorrect:

    AND (src_terrier.Areacode LIKE @chr_div+ '%')

    so if @chr_div = 'EV', the addition of the % sign makes the wild card search anything that STARTS with 'EV', like 'evansville'...

  • RE: IN or OR

    if the IN statement was running accross a bigger list, like  in(SELECT X FROM SOME TABLE),

    I would expect it should be faster, because it would bailout as true on the...

  • RE: Connecting to an Internet database

    i doubt it; most db servers are hidden behind the firewall at the hosting company, and only the web server can see the db server.

    but that also means that you...

  • RE: Case, loop or cursor

    just missing the END command of the case statement: let me know how this seems to work now

     (CASE WHEN @PropertyValue BETWEEN 1 AND 10

      THEN @PropertyValue * 100000

      WHEN @PropertyValue...

  • RE: Case, loop or cursor

    there are quite a few on this site;

    here is an example using this version of split:

    http://www.sqlservercentral.com/scripts/viewscript.asp?scriptid=225

     

    declare @string        varchar(200),

            @LeadTimeFrame int

    set @LeadTimeFrame=3

    if @LeadTimeFrame = 1       set @string='24'

    else if @LeadTimeFrame =...

  • RE: Case, loop or cursor

    MAYBE another indicator is this: the only difference i see forwhen

     IF (@LeadTimeFrame = 1)

    is evaluated, the SQL is the same except for an additional check in the WHERE...

  • RE: Case, loop or cursor

    i can see a minor improvement; it looks like that huge if-then-else to get the @PriceRange  could be replaced by a three line case statement:

    SET @PriceRange = (CASE...

Viewing 15 posts - 13,036 through 13,050 (of 13,445 total)