Forum Replies Created

Viewing 15 posts - 31 through 45 (of 95 total)

  • RE: xp_sendmail - empty subject

    If your @subject value is set via a process(ie from a table, view, function, or sp)..make sure the user has privs on this process.

     

    HTH

  • RE: SQL Query Help

    Ray..gives you a good solution...

    but you may want to call it...

    Select distinct OrderID, dbo.fn_ConcatStrings (OrderID)

    From Mytable

  • RE: Times by quarterhour

    not tested but ...Something like this...

    declare @results table

    (

    [Hour] int,

    QTR_Hour datetime,

    Shift char(1) default 'N',

    TotalHoldSecs int default 0

    )

    --set a @start and @end time manually if you want

    declare @start datetime,

    @end datetime

    set @start =...

  • RE: Attaching mulitple databases

    create a temp table with databasenames, and log file locations..etc..

    Use a cursor to use sp_attach_db to attach each on.

    HTH

  • RE: Selecting between two fields

    declare @table table

    (

    some_value varchar(50),

    some_other_value varchar(50),

    some_other_other_value varchar(50)

    )

    insert @table

    select NULL,NULL,'easy'

    union all

    select NULL,'as','abc'

    union all

    select '123',NULL,'abc'

    union all

    select NULL,NULL,NULL

    select coalesce(some_value,some_other_value,some_other_other_value,'Nothing there')

    from @table

  • RE: Date formatting problem

    print substring(convert(varchar(10),getdate(),2),4,2)+'/'+substring(convert(varchar(10),getdate(),2),7,2)+'/'+substring(convert(varchar(10),getdate(),2),1,2)

  • RE: inserting decimal point

    declare @table table

    (

    some_value varchar(10)

    )

    insert @table

    select '250'

    union all

    select '25001'

    union all

    select '7265'

    union all

    select 'V4521'

    update @table

    set some_value = x.some_value

    from @table t

    join

    (

    select some_value old_value,case when LEN(some_value) <= 3 then LEFT(LTRIM(some_value),3) +...

  • RE: Microsoft Support for SQL Server 2000

    2 yrs for Mainstream support

    5 yrs for Extended support.

     http://support.microsoft.com/lifecycle/?p1=2852

  • RE: Excel Import problem

    This is known issue.  If you format the columns in excel and have the data re-entered, it should fix your problem(apparently just changing the format for entered data doesnt work). ...

  • RE: Run SQL in a .NET Thread

    I've done some thing similar a while back.  I will say it is inefficient ..the main problem I had was determining whether the thread had completed.  Basically find the spid...

  • RE: Temp Tables x SPID

    If you can use global temp tables...

     IF EXISTS (SELECT 1 FROM TEMPDB..SYSOBJECTS WHERE NAME = '##xx' AND TYPE = 'U')

     BEGIN

      DROP TABLE ##xx

     END

    If you are using local temp tables, the...

  • RE: Invalid column error

    Something like this..

     

    if(SELECT count(*) FROM INFORMATION_SCHEMA.COLUMNS

    WHERE TABLE_NAME = 'RESULTS'

    AND COLUMN_NAME = 'TOTAL_VOTES') = 0

    BEGIN

    ALTER TABLE [dbo].[RESULTS] ADD [TOTAL_VOTES] as Option1 + Option2

    END

    HTH

  • RE: sql max() function

    I solve this as follows...

    This approach would allow you get any rank

    Select top 1 Salary

    from

    (

    Select top 2 Salary

    from Salary

    order by Salary desc

    )

    order by salary asc 

    HTH

  • RE: Conditional Summing

    This is the standard boundary value problem in SQL Server.  Make sure you understand what is meant by "open" and "closed' interval or you run the risk of dubling some...

  • RE: T-SQL #TempTable headace

    Mathew..have you tried creating the table before your conditional statements.and inserting into the created table(instead of doing insert into) ?

     

     

Viewing 15 posts - 31 through 45 (of 95 total)