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...
Thanks you george,
but this is returing all the db objects referencing the table though the column is not used there
can we do some kind of magic here and restrict the output to those DB objects refering the column
Thanks again
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...
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) = '((' then 'ABC+F1' end
to sort the data
I wanted...
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...
Alex,
Thank you very much for your swift response, I see one problem with this solution
check it for this data
[code]
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', '01/17/2007'...
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'...
Thank you denis for your suggestion,
I have one que, is is going to executethe insert statement even if the insert statement for the error log if after roll back
i.e
proc
begin tran
.
.
.
@error = @@error
go to error
.
.
.
commit tran
error:
if @error <> 0
roll back
insert into...
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...
Thanks george
this is not giving me the right data, it doesn't fullfill my first requirment which is
if tbl2 is not empty,
only records from tbl1 that having matching values in tbl2 will be selected (i.e only those col1 values of tbl1 existing in tbl2 will be picked)
in our case our...
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.