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 SkipVought 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

    please discard the above post below is the correct one I have two tables, @tmpTable4 and @ReportTable, I wrote this script to update the last two fields of table @tmpTable4 i.e. ISDEL and REMARK with the last two fields of @ReportTable but it is not updating what will be the reason here is...
  9. habneh

    Problem with a NULL field

    I have two tables, @tmpTable4 and @ReportTable, I wrote this script to update the last two fields of table @tmpTable4 i.e. ISDEL and REMARK with the last two fields of @ReportTable but it is not updating what will be the reason here is the script SET ANSI_NULLS OFF GO DECLARE @ReportTable...
  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?

    I want to update a table tbl on serer svr1 and database db1 update tmp set tmp.col = case when 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...
  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

    I am trying to get the max employee change number for some reason when an employee doesn't have change number i.e when it is null, my query doesn't pick that specific record. below is the query I wrote what is the problem with my query create table #tmp (ID int, EMP_ID int, EMP_VER_NUMBER...

Part and Inventory Search

Back
Top