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 strongm 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: fikir
  • Content: Threads
  • Order by date
  1. fikir

    combining three tables into one

    I have three tables tbl1, tbl2 and tbl3, all having employee info declare @tbl1 table (id int name varchar(20) declare @tbl2 table (id int name varchar(20) declare @tbl3 table (id int name varchar(20) insert into @tbl1 select 1, 'John' union all select 2, 'Merry' union all select 3...
  2. fikir

    problem with archiving a text datatype field to text file

    I have a table which two of its fields are text datatype I am trying to archive this table to text file, but because of the size of these fields it is failing it error is 'column x the data source is too large for the buffer' what should I do to solve this problem Thanks
  3. fikir

    appending a file in DTS package

    I am trying to append a file to existing text file in DTS and wrote this VB script '********************************************************************** ' Visual Basic ActiveX Script '************************************************************************ Function Main() Dim oFSO Dim...
  4. fikir

    searching column name in databasebase objects

    hello, I am facing a big problem, I am changig the data type of one of my column from numeric to varchar(100), The conversion is not a problem, I did alter the column to varchar(100) in the table what I want to find is all the names of database objects (procedures, fuctions, views..) where I...
  5. fikir

    order by problem

    I have this table and trying to order by [code] declare @tbl table (col varchar(100)) insert into @tbl select '((ABC)+F)' union all select '123' union all select 'ABC+F' union all select 'DEF' union all select 'XYZ' I wrote this query select * from @tbl order by case when left(col, 2) =...
  6. fikir

    top keyword with group by

    One thing is troubling me I have a table delcare @tbl table (depid int, empid int) insert into @tbl select 1, 11 union all select 1, 12 union all select 1, 13 union all select 1, 14 union all select 2, 20 union all select 2, 23 union all select 3, 30 I want to select any top max 2 empid for...
  7. fikir

    get squence of date

    I have this table, with site id, visitstartdate and visitenddate I am trying to get the sequence of visit, and wrote this query DECLARE @TBL TABLE (ID INT, VSTARTDATE DATETIME, VENDDATE DATETIME) INSERT INTO @TBL SELECT 1, '01/01/2007', '01/10/2007' UNION ALL SELECT 1, '01/03/2007'...
  8. fikir

    error log table is rolling back

    I have one big proc which is inserting data to more than 15 tables. all the insertion is carried out in a single transaction. The problem is I have an error log table whch catches errors after each insertion. my question is when the procedure is failing somewhere, I am not seeing any error...
  9. fikir

    joining two tables

    hello all, I need your help on this I have two tables tbl1 col1 col2 1 aa 2 bb 3 cc and tbl2 col1 col2 1 dd 2 ee I want to write a simple query so that, I select records from tbl1 on two conditions i. if records exist in tbl2 , then their...
  10. fikir

    delete statement conflicting with foreign key

    I have two tables they have a foreign key relationship tbl1 col1 col2 col3 1 1 a 2 1 b 3 2 c tbl2 col1 col2 1 aa 2 bb the foreign key is defined on col2 of tbl1 referncing col1 of tbl2 I am tring to delete data from both tables and wrote this kind of query...
  11. fikir

    handling a transaction

    I am a bit confused here with handling a transaction I am trying to insert data into a series of production tables. insert into tbl1 (col1, col2) select colt, col2 from stagingTable1 --error handling insert into tbl2 (col1, col2 select col1, col2 from stagingTable2 --error handling . . ...
  12. fikir

    help with TSQL query

    Hello everyone, I have one question, we have a table called organizations and It has three columns (actually it has more than three column but therese are enough for the query orgId visitStartdate visitEndDate 1 01/01/2007 01/05/2007 1 02/05/2007...
  13. fikir

    returning a list of records

    I have a table called emplyee empId empname 1 John 2 Sean 3 Merry each employee participate in one or more different projects I am planning to get the list of projects the employee are taking part I wrote a function fnProj which accepts an emplyee Id and...
  14. fikir

    add a column and update it

    I am trying to add a column to existing table and update it it is erroring out here is the code alter table employee add stu_id numerin(10) update employee set stu_id = e2.stu_id from employee e1 inner join employee2 e2 on e1.id = e2.id Thanks,
  15. fikir

    hint on archiving data to XML file

    I am having a big task infront of me I am trying to do dome archiving data which are 300 days and more older from our tables to xml files, if any one have a link which discribes about this Thanks
  16. fikir

    performance problem

    this query is taking time select * from tbl1 where id in (select id from splitFunction(@listOfIds, ',') or not exists(select id from splitFunction(@listOfIds, ',') @listOfIds ia a variable with list of id's and what the query does is select ids if they exist in the list, but if the @listOfIds...
  17. fikir

    calling table valued function in select statement

    hello every one I have a table valued function. and trying to use it in a select statement like this select (select first_name from tblValuedFunction(per.id) as name from person it is generating an error how can I call a table vaued function in select statemet Thanks,
  18. fikir

    problem with sp_MSForEachTable

    what is wrong with this query EXEC sp_MSForEachTable 'IF left(''?'',12) = ''[FastActRes]'' begin UPDATE ? SET TO_BE_LOADED = ''Yes'' end' Only those with schema FastActRes have...
  19. fikir

    carrage return character withn column value

    hello every one I have a table tbl1 perId perName perAddress 1 James washington DC, fairfax VA 2 Bob seattle WA, Los Angeles CA I want to write a query so that the different addresses will be carrage return separated the result should look like perId...
  20. fikir

    trying to update similar tables

    I have two tables which are similar declare @tbl table (id int primary key, name varchar(100)) declare @tbl2 table (id int primary key, name varchar(100), flag varchar(10)) insert into @tbl select 1, 'abc'...

Part and Inventory Search

Back
Top