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...
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
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...
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...
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) =...
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...
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'...
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...
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...
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...
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
.
.
...
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...
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...
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,
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
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...
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,
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...
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...
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'...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.