Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: habneh
  • Order by date
  1. habneh

    help with the duplicate column values

    Thanks for your response. But I am not getting your idea Can you try with this data declare @tbl1 table (id int, pname varchar(100) ) declare @tbl2 table (id1 int, id int, fname varchar(100) ) insert into @tbl1 (id, pname) select 1, 'aa' union all select 2, 'bb' union all select 3, 'cc'...
  2. habneh

    help with the duplicate column values

    Here is a data declare @tbl1 table (id int, pname varchar(100) ) declare @tbl2 table (id1 int, id int, fname varchar(100) ) insert into @tbl1 (id, pname) select 1, 'aa' union all select 2, 'bb' union all select 3, 'cc' insert into @tbl2 (id1, id, fname) select 1, 1, 'dd' union all select...
  3. habneh

    help with the duplicate column values

    I have tables say tbl1, tbl2, tbl3 I am joing this table to get back some recordsets select a.col1 b.col2 c.col3 from tbl1 a inner join tbl2 b on a.col1 = b.col2 inner join tbl3 c on b.col1 = c.col2 the resultset will teturn col1 col2 col3 1370 1446 aa...
  4. habneh

    Problem with a NULL field

    Thank you very much paul Here id ***** for you that really works great thanks
  5. habneh

    Problem with a NULL field

    I should keep all them though. The problem is with the NULL, if one field is Null, I think I can't equate the Null field I used 'SET ANSI_NULLS OFF' in my code, it is not helping out any suggestion how to equate two null fields? Thanks
  6. habneh

    Problem with a NULL field

    No it is not returning any data
  7. habneh

    Problem with a NULL field

    Thanks Monk still not working for the last two columns instead of updating them, it leaves them as NULL
  8. habneh

    Problem with a NULL field

    ...tmp2 INNER JOIN @ReportTable tmp ON tmp2.ID = tmp.ID AND tmp2.DOCID = tmp.DOCID AND tmp2.VNum = tmp.VNum AND tmp2.[Date] = tmp.[Date] AND tmp2.IDEN = tmp.IDEN AND tmp2.IDENDate = tmp.IDENDate SELECT * FROM @tmpTable4 GO SET ANSI_NULLS ON thanks,
  9. habneh

    Problem with a NULL field

    ...tmp2 INNER JOIN @ReportTable tmp ON tmp2.ID = tmp.ID AND tmp2.DOCID = tmp.DOCID AND tmp2.VNum = tmp.VNum AND tmp2.[Date] = tmp.[Date] AND tmp2.IDEN = tmp.IDEN AND tmp2.IDENDate = tmp.IDENDate SELECT * FROM @tmpTable4 GO SET ANSI_NULLS ON thanks,
  10. habneh

    passing server name as parameter

    Thanks again really appreciate that
  11. habneh

    passing server name as parameter

    Thank you paul, can you give me a sample code whcih describes this Thanks,
  12. habneh

    passing server name as parameter

    I wrote a query which can be run on different servers I want to pass the server name and database name as a parameter to my query. how can I do that can I do select * from @servername.@databasename.dbo.tbl Thanks
  13. habneh

    What is wrong with this query?

    you mean update svr1.db1.dbo.tmp set col1 = 'a'? I tried this and generated this error [OLE/DB provider returned message: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.] OLE DB error trace [OLE/DB Provider 'SQLOLEDB'...
  14. habneh

    What is wrong with this query?

    Thanks, alex how can we do update via linked server
  15. habneh

    What is wrong with this query?

    ...tmp.col1 = 1 then tmp.col1 + 1 else tmp.col1 + 2 end from OPENROWSET('SQLOLEDB','svr1';'uid';'pwd','select * from db1.dbo.tbl') tmp but it is erroring the error is Msg 208, Level 16, State 1, Line 1 Invalid object name 'tmp'. a linkedserver is all...
  16. habneh

    update tables on another server

    I have created a linked list, but it still fails to update here is the error [OLE/DB provider returned message: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.] OLE DB error trace [OLE/DB Provider 'SQLOLEDB'...
  17. habneh

    update tables on another server

    I have a table called tbl on server svr1, database db1, owner is dbo I want to update it from server svr2, database db2 I wrote a query update svr1.db1.dbo.tbl set col1 = case when col1 = 1 then 1.0 else 2.0 end where col2 = 'aa' but it is complaining what should...
  18. habneh

    Problem with null

    That was really cool!!! Thank you very much
  19. habneh

    Problem with null

    Thanks but still missing the record with ID 16 (it didn't solve my problem)
  20. habneh

    Problem with null

    ...#tmp select 14,4,3,NULL insert #tmp select 15,4,3,2 insert #tmp select 16,5,3,NULL insert #tmp select 17,6,3,1 SET ANSI_NULLS OFF SELECT * FROM #tmp A WHERE A.EMP_CHANGE_NUMBER = (SELECT MAX(EMP_CHANGE_NUMBER) FROM #tmp B...

Part and Inventory Search

Back
Top