Forum Replies Created

Viewing 15 posts - 1,231 through 1,245 (of 2,007 total)

  • RE: t sql funny

    darth_vodka (12/1/2011)


    aaaaaaaaaaaaaaah

    brilliant

    memo to self...use "IS NULL" not "ISNULL"

    thanks guys

    It has nothing to do with ISNULL. It has to do with the implicit conversion of the empty string into a DATETIME.

    You...

  • RE: How to access exchange server emails from sql server

    deepkt (12/1/2011)


    Thanks for your reply.

    If possible please post some code. Suggest me list of steps. Is it possible to connect Exchange server 2007 using SSIS?

    Thanks.

    http://msdn.microsoft.com/en-us/library/ms191461.aspx

    EXEC sp_addlinkedserver 'exchange',

    'Exchange OLE DB...

  • RE: Filter Large table using small one

    Define the "first occurrence". SQL is unordered sets of data, so there is no defined "first" unless specified by the code in an ORDER BY.

    With the sample data you have...

  • RE: t sql funny

    Because your WHERE clause is implicitly converting an empty string to a datetime.

    e.g.

    SELECT CAST('' AS DATETIME)

    Which equals "1900-01-01 00:00:00.000".

    So your WHERE clause is basically as follows: -

    WHERE ISNULL(a.DayBase,'') <> '1900-01-01...

  • RE: How to concatenate fields and group them?

    cliff.gettings (11/30/2011)


    Thanks Drew,

    Unfortunately, I still unsure what to do.. you refer to a csv file? I don't have this in a csv file, these are in a table in SQL...

  • RE: how to join two tables with non equal conditions?

    Here's the responses from the other version of this post -

    Cadavre (12/1/2011)


    SELECT aYr, bYr, aCol, CASE WHEN aYr = bYr

    ...

  • RE: how to join two tables with non equal conditions?

    And another

    SELECT aYr, bYr, aCol, bCol

    FROM #A a

    INNER JOIN (SELECT bYr, bCol, MAX(bYr) OVER (PARTITION BY (SELECT NULL)) AS maxbYr

    ...

  • RE: Filter Large table using small one

    tmccar (12/1/2011)


    Sorry but I'm not sure what this does. I ran the query and it says

    Ummm. . .

    Cadavre (12/1/2011)


    Please write your sample data in this format

    I was showing you how...

  • RE: select rowid?

    Not sure I know what you're asking. Does this help?

    BEGIN TRAN

    CREATE TABLE #user

    (id int identity(1, 1),

    userid int,

    firstname VARCHAR(20) NULL,)

    INSERT INTO #user (userid,firstname) VALUES (4,'Duke')

    INSERT INTO #user (userid,firstname) VALUES (5,'David')

    INSERT INTO...

  • RE: how to join two tables with non equal conditions?

    Untested: -

    CREATE TABLE #A (aYr INT, aCol INT)

    INSERT #A (aYr, aCol) VALUES (2008, 2)

    INSERT #A (aYr, aCol) VALUES (2009, 5)

    INSERT #A (aYr, aCol) VALUES (2010, 9)

    INSERT #A (aYr, aCol) VALUES...

  • RE: Are the posted questions getting worse?

    bitbucket-25253 (11/30/2011)


    My observation of comments on mine, plus those on yours, shows just one thing. How disrespectful people can be. I noticed the "incorrect" text in the CORRECT...

  • RE: Filter Large table using small one

    tmccar (12/1/2011)


    Yes, you are right - the drawing number should not have the ".dwg" extension

    OK, here is what I've tried:

    SELECT Smalltable.[Drawing Number], "Path"

    FROM Smalltable

    INNER JOIN Largetable

    ON Smalltable.[Drawing Number]=Largetable.[Drawing Number]

    But I'm...

  • RE: XML

    What was with the font size? I had to zoom out to 5% to be able to fit it on my screen! 😛

  • RE: Help with hard Sql update

    itay barda (12/1/2011)


    I now added a primary key to this table. it's identity 1,2,3,4...

    What John was asking you for was ddl scripts and readily consumable sample data, such as this:...

  • RE: Finding the next date after a start date that is a certain day of the week

    And another, far uglier method 😀

    DECLARE @startdate DATETIME

    SET @startdate = '2011-11-18'

    SELECT DATEADD(DAY,ISNULL(NULLIF(ISNULL(NULLIF(ISNULL(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(DATEDIFF(dd,0,@startdate)%7,0),1),2),3),6),1),4),3),5),2), @startdate)

Viewing 15 posts - 1,231 through 1,245 (of 2,007 total)