Forum Replies Created

Viewing 15 posts - 4,516 through 4,530 (of 5,504 total)

  • RE: How do I schedule to send out query result in certain format like csv or xls? Thanks.

    You might want to check this thread.

    Seemes like someone finally found a way to do it. I haven't tested it myself though...

  • RE: concatenate

    Paul White (1/12/2010)


    Perfect Lutz!

    Thank you, Paul! :blush:

    It's starting to pay off hanging around here for a while.... 😉

  • RE: concatenate

    The following should at least help you to get you started (please note how I set up sample data in a ready to use format...)

    DECLARE @t TABLE (ID INT ,Key_...

  • RE: import from excel to a sql table

    I cannot confirm what you describe:

    Table definition:

    CREATE TABLE [dbo].[Table_1](

    [z] [int] IDENTITY(1,1) NOT NULL,

    [a] [int] NULL,

    [int] NULL,

    [c] [int] NULL,

    [d] [datetime] NULL CONSTRAINT [DF_Table_1_d] DEFAULT (getdate())

    ) ON [PRIMARY]

    Excel file (grid...

  • RE: update qry

    Lynn Pettis (1/12/2010)


    We are updating the column with the results of the "concatenation". Since the field is real (numeric) 2009.1 and 2009.10 are the same.

    It's still an insoluble puzzle...

  • RE: update qry

    Just for the sake of it (since the business reason is still a secret to me):

    DECLARE @TheColumn INT

    SET @TheColumn = 1

    SELECT left((2009 + @TheColumn / CASE WHEN @TheColumn <10...

  • RE: update qry

    Lynn Pettis (1/12/2010)


    ...

    Basically:

    2009. + 1 = 2009.1

    2009. + 10 = 2009.10

    Both values are numerically the same and the column is defined as a real value. ...

    Completely understood. But...

  • RE: update qry

    Tara-1044200 (1/12/2010)


    great, Lynn's query

    update dbo.TheTable set

    TheColumn = 2009 + (TheColumn / 100.00)

    worked for me.

    For the same real data type how would i update...

  • RE: update qry

    WayneS (1/12/2010)


    ..

    The data was enclosed in quotation marks, so it was assumed that this was a string.

    ...

    I agree with you and my comment didn't question your solution at all...

    Since we're...

  • RE: Update field after stiping brackets from data

    Armani (1/12/2010)


    below did it

    update dbo.testtable set testcode = substring(testcode,1,len(testcode)-1)

    Thanks

    That's really strange...

    Your query only removes the last character, but not the first one:

    declare @x varchar(50)

    SET @x='{FFFFFFFF-0000-0000-0000-000000000463}'

    SELECT substring(@x,1,len(@x)-1) --{FFFFFFFF-0000-0000-0000-000000000463

    SELECT substring(@x,2,len(@x)-2) --FFFFFFFF-0000-0000-0000-000000000463

    But...

  • RE: update qry

    Here's what I came up with to cover the options I think we're faced with...

    If the base column is of data tpe INT I actually doubt that it would be...

  • RE: Challenging - SQL XML Task

    sanjai.nbs 57867 (1/12/2010)


    I got to know there is no such option to get the data in MODIFY(). SO I did that with some other method.. Thanks 4 everyone

    Excellent you found...

  • RE: How do I schedule to send out query result in certain format like csv or xls? Thanks.

    Based on BOL, extended by some more parameter (untested, but should work):

    EXEC msdb.dbo.sp_send_dbmail

    @profile_name = 'AdventureWorks Administrator',

    @recipients = 'danw@Adventure-Works.com',

    @query...

  • RE: Where are you?

    Leipzig, (South-) East Germany, Central Europe. 🙂

  • RE: How do I schedule to send out query result in certain format like csv or xls? Thanks.

    It depends on where you want to start...

    Assuming, you need to start from the very beginning, I'd recommend the following article:

    http://www.sqlservercentral.com/articles/Administration/introtodatabasemailinsql2005/2197/

    Once you succesfully send the testmail you should check...

Viewing 15 posts - 4,516 through 4,530 (of 5,504 total)