Forum Replies Created

Viewing 15 posts - 1,486 through 1,500 (of 1,923 total)

  • RE: Create temp table with from existing table adding a new column

    Jeff Moden (5/21/2010)


    The ISNULL is responsible for making the column with a NOT NULL constraint. Works dandy especially when the column is going to be a candidate for...

  • RE: Create temp table with from existing table adding a new column

    Don't use INSERT INTO, rather use SELECT * INTO for the new 7 column temp table. Like:

    SELECT COL1, COL2, COL2 , COL4, COL5, COL6, NULL COL7

    INTO #TEMP

    FROM REALTABLE

    And then...

  • RE: Change SQL server Dateformat?

    Kannbiran, when u change the dateformat to DMY, the insert statement must also follow suite and contain rows like '01-Mar-2010' or '30-03-2010' etc..

  • RE: Remove Pattern in sql query

    Jeff Moden (5/19/2010)


    ColdCoffee (5/19/2010)


    Thanks Jeffy;

    Ummm.... not to be a stick in the mud but two people in the known universe get to call me "Jeffy"... and you're not either one...

  • RE: Stored Procedure to copy images

    Jack Corbett (5/19/2010)


    T-SQL is not the best solution for this. You could write a .NET program that reads the paths from the database and moves the images or you...

  • RE: convert an interger to time

    WayneS (5/19/2010)


    Slight modifications to the solution already provided by ColdCoffee, in order to show with the field name you specified. And a way to eliminate the case statement.

    DECLARE @YOUR_TABLE TABLE...

  • RE: convert an interger to time

    I will go further and give you this:

    1. First the sample table and sample rows set up

    DECLARE @NUM_TABLE TABLE

    (

    NUM INT

    )

    INSERT INTO @NUM_TABLE

    SELECT 11536 UNION

    SELECT 123057 UNION

    SELECT 11015...

  • RE: convert an interger to time

    Hi there, try this:

    select stuff( stuff(cast(015136 as varchar),2,0,':') , 5,0,':')

    😎

  • RE: Remove Pattern in sql query

    Jeff Moden (5/19/2010)


    ColdCoffee (5/18/2010)


    Jeff Moden (5/18/2010)


    niteshrajgopal (5/18/2010)


    Hi again, is there anyway I can add to your reputation or something on this forum:-)

    Heh... not to worry. CC is building his...

  • RE: Need help on dynamic SQL

    You can use homebrew01's idea, but then there is a catch there; when u declare it inside the dynamic sql, your code which used "maxno" has to be packed up...

  • RE: T-SQL Query to Get SUM(COUNT())

    Hi, This is my first attempt at running totals, hope i am not screwing up anything!

    Now setting up the test environtment:

    SET DATEFORMAT YMD

    IF OBJECT_ID('TEMPDB..#A') IS NOT NULL

    DROP TABLE #A

    CREATE TABLE...

  • RE: Stored Procedure to copy images

    Hi, if your table would not have millions and millions of record, then the following code would suffice your needs!

    Code :

    1. The test set-up ; Please look at how...

  • RE: Comparing spaces characters

    Use DATALENGHT function, This will calculate white spaces at both ends of the string. This might help your cause!

  • RE: Comparing spaces characters

    You may probably wnat to read thro one excellent article from Jeff Moden on how to "REPLACE Multiple Spaces with One"

    LINK : REPLACE Multiple Spaces with One[/url]

    Hope this helps you!

  • RE: CHARINDEX is not Case Sensitive?

    You can make use of the ASCII funtion!

    Like this

    SELECT ASCII('x') -- = 120

    SELECT ASCII('X') -- = 88

    Now u can compare both the fields and when then match do something...

Viewing 15 posts - 1,486 through 1,500 (of 1,923 total)