Forum Replies Created

Viewing 15 posts - 46 through 60 (of 388 total)

  • RE: how to use One CTE value in another CTE ,in SQL 2008 R2

    The first point is that at some stage you want to SELECT (outside of the CTE) to get some results.

    ....CTE3 AS

    (

    Select ( CTE1.Cnt_Column1_Tbl1 - CTE2.Cnt_Column2_Tbl2) -- I get an error...

  • RE: Storing XML File

    kapil_kk (2/10/2014)

    Instead of same server location I want to store it to different location. How can I achieve that?

    If I've understood correctly, your code works, to save on the database...

  • RE: Including the filename in a bcp load.

    Lowell (2/7/2014)


    David, where would you put the data reference to the file? is there an additional column at the end of the table, that you can use to update right...

  • RE: Including the filename in a bcp load.

    Hi Lowell,

    Thanks for this idea. I did try almost exactly this, but I was using osql. For whatever reason, I couldn't get the osql call to...

  • RE: Sending a Variable Number of Elements in a Parameter

    Jeff Moden (2/6/2014)


    As someone that's followed SSC for a number of years, I think there's a danger of the articles becoming a private members club, where the uninitiated are put...

  • RE: Sending a Variable Number of Elements in a Parameter

    dwain.c (2/6/2014)


    It seems that the harsh critic has been universally condemned for his harsh remarks. You know what they say about movie critics, if you can't act become a...

  • RE: Sending a Variable Number of Elements in a Parameter

    Damned if you do, damned if you don't!

    I find the criticism somewhat harsh. Am I alone in thinking that articles don't have to be exhaustive? I can see...

  • RE: sql case when statement

    Lowell (2/4/2014)


    there's a lot of logic holes in here; are we trying to find the fiscal start date or something? is the 05 date a copy paste err, and it...

  • RE: Nested stored procedures and EXECUTE statements (Dynamic SQL)

    Are you rolling back your transaction in the CATCH AFTER you write to the error log? i.e. rolling back your record of a problem occuring.

    sequence should be I guess

    ...catch

    ---...

  • RE: How to see foreign key relationship

    p.s. you can also see this visually if you create a diagram, and add the table you're interested in. Then right-click the table and choose 'add related tables.'

  • RE: Generate Scripts

    I may be missing your point, but when I go into Tools / Options / SQL Server Object Explorer / Scripting, I can set script indexes to true. From...

  • RE: Convert Float to DateTime

    Abu Dina (1/15/2014)


    Nice 1 David:

    This is my attempt lol:

    declare @test-2 float = '1.21793287400577E+15'

    select left(cast(CAST(@test as bigint) as varchar(20)), LEN(cast(CAST(@test as bigint) as varchar(20)))-6)

    select DATEADD(SS, CAST(left(cast(CAST(@test as bigint) as...

  • RE: Convert Float to DateTime

    SELECT dateadd(s,cast(1.21793287400577E+15 AS bigint) / 1000000,'1 jan 1960')

  • RE: Convert Float to DateTime

    just going from your definition, I pasted the number into Excel

    which gave me

    1217932874005770

    I then removed the last 6 digits which gave me

    1217932874

    and finally did a dateadd

    SELECT dateadd(s,1217932874,'1 jan...

  • RE: copy/paste multiple columns

    liver.larson (10/15/2013)


    that's unfortunate. Thanks for replying. I've been wondering about that for a while, but didn't find any threads anywhere on the shortcuts. cheers

    You're welcome. As an additional demonstration,...

Viewing 15 posts - 46 through 60 (of 388 total)