Forum Replies Created

Viewing 15 posts - 6,781 through 6,795 (of 13,469 total)

  • RE: find the maximum length of sequences in a column

    looking at it but my first try didn't make sense;

    here's sample data for other posters to fiddle with:

    ;with MySampleData (TheDate,TheValue)

    AS

    (

    SELECT CONVERT(datetime,'20100101'),'-1' UNION ALL

    SELECT '20100201','-1' UNION ALL

    SELECT '20100301','1' UNION ALL

    SELECT '20100401','1'...

  • RE: Query optimizing 2

    i think you can just do it with inline SUM..CASE...

    you almost had the syntax in your example:

    does this do what you wanted?

    SELECT

    ...

  • RE: How do I import this data?!

    dave_vicary (9/15/2011)


    Okay that makes sense, I copied the data into wordpad!

    Now receiving this error:

    Msg 208, Level 16, State 82, Line 1Invalid object name 'BULKDATA'.

    Sorry to keep bugging you with...

  • RE: remove 'dead views'

    glen.wass (9/15/2011)


    HI if your willing to share i would love a copy of the script you mention i have SQL2005 and 2008

    It's here on the forums in a few different...

  • RE: How do I import this data?!

    i copy and pasted the file into a text document from the web page, so my lines all ended in Carriage Return Line feeds(CHAR(13) + CHAR(10) because of the enhanced...

  • RE: Reverse Engineer SQL Scrpts

    note that those two new DM views are in SQL 2008R2 and above:

    sys.dm_sql_referencing_entities

    sys.dm_sql_referenced_entities

    i went to test in 2008 and saw they were not there...

    you might have to stick witht...

  • RE: deleting data in all tables

    yeah without taking Foreign keys into consideration, doing a straight DELETE will typically raise errors .

    this snippet generates teh TRUNCATE TABLE/DELETE FROM statements in Foreign key hierarchy Order:

    that avoids issues...

  • RE: Insert

    Beginner_2008 (9/14/2011)


    Can anybody help me in insert statement:

    I have a table say table 1 which has many columns but out of these one column say Tid is null and all...

  • RE: remove 'dead views'

    views(as well as procs and functions) can become invalid if the underlying tables/views they use have changed, got dropped, etc.

    in SQL 2000 (the forum you posted in) you cannot use...

  • RE: How can we Upload files to SFTP server using SQLSERVER 2005 Stored procedures.

    you can call CoreFTP via a command line, and it supports SFTP.

    once a profile is setup for the destination SFTP with the username and password in it, you can call...

  • RE: How do I import this data?!

    all right, this was interesting for me, as I know i could do it in TSQL.

    here's a working solution for header and data...i ignored the footer information for now.

    copy and...

  • RE: Assigning values using CASE statmenent

    well, you are using a two part test for the "Cash Payment"...chknumber has to be blank and ALSO you are checking the amount...

    i'd think that the amount may be...

  • RE: Assigning values using CASE statmenent

    yep null would probably be the culprit; just wraping it with ISNULL should fix it i think:

    select

    CASE

    WHEN ISNULL(chcknumber,'') = '' AND checkAmount <> ''...

  • RE: Assigning values using CASE statmenent

    just syntax; the case returns the desired value only, so you can't have a assigning, like that chknbr='Cash':

    select

    CASE

    WHEN chcknumber='' AND checkAmount <> ''

    ...

  • RE: Foreign Key Index

    here's my take on it;

    this query featuring a CTE lists all foreign keys, and if there is an index with the leading column on the child table or not.

    if it...

Viewing 15 posts - 6,781 through 6,795 (of 13,469 total)