Forum Replies Created

Viewing 15 posts - 106 through 120 (of 141 total)

  • RE: Problems with SELF Join

    I know my query will fail of there are any records with duplicate o_id and o_tmst, as per your sample data, but the primary key should stop the duplicates being...

  • RE: Incorrect Results using Convert Query

    Sometimes it just needs a fresh pair of eyes, to look at the problem from a different angle.

  • RE: Problems with SELF Join

    try:

    SELECT a.o_id

     , a.o_tmst

     , a.from_dept

     , isnull(b.to_dept, '')

     , a.to_dept

     from dummy a

     left join dummy b

      on a.o_id = b.o_id and b.o_tmst = ( select max( o_tmst)

           from dummy c

           where c.o_tmst < a.o_tmst...

  • RE: Incorrect Results using Convert Query

    It may be obvious, but check that your IIS page is connecting to the same server and database that you are running the query on. Check the contents of the...

  • RE: Max data length of a NTEXT column

    Yes, sorry Jonathon. But you could use the following script to find the maximum record length that could be returned by a query (using datalength) with reference to your current...

  • RE: Formatting Query output column width

    or

      select 'ServerRole' = left(spv.name, 10), 'MemberName' = left(lgn.name, 30)

       from master.dbo.spt_values spv, master.dbo.sysxlogins lgn

       where spv.name = 'sysadmin' and

          spv.low = 0 and

          spv.type = 'SRV' and

          lgn.srvid...

  • RE: ODBC Connection-Named Pipes vs TCPIP

    On my system users connect with Named pipes one day, TCP/IP the next and named pipes the following day. At the moment I have 2 users on named pipes and...

  • RE: Max data length of a NTEXT column

    You can try extracting the information from

    select * from information_schema.columns

    Regards

    Peter

  • RE: Log shipping issue

    I am doing manual 'log shipping' a slightly different way to you, so I don't know if my experience will help. I have got the equivalent of log shipping by doing...

  • RE: insert..select performance HORRIBLE

    Also if you have a clustered index on the table being INSERTed into the data is stored in the clustered index order. Try using an ORDER BY clause to order the selected data...

  • RE: ODBC errors

    It may not help, but I have been experiencing a similar problem with a VB6 application that runs on either Access or SQLserver but uses linked tables from access to...

  • RE: Cross Server Procedure Exection

    If the server is a 'linked' server you don't need to use OPENROWSET(), you just refer to the stored procedure using the full 4 part reference. eg

    exec linkedservername.database.dbo.storedprocname

    The interesting thing is that the...

  • RE: Error 512: Subquery returned more than 1 value....

    Run the profiler as geh1 suggests to see the query that is causing the problem.

    It sounds like one of your 'Backup...' system tables on database MSDB might have a problem...

  • RE: Link Serevr

    I am not sure, but there could be a small limit on the size of the query in OPENQUERY, such as 255 characters. Try putting the Where id in ()...

  • RE: Output results based on row comparison?

    Yes, #temp is refered to 3 times with three different aliases: 't1' & 't2' in the main query and 't' in the sub query. I suppose I could have used...

Viewing 15 posts - 106 through 120 (of 141 total)