Henry,
you say you are comparing number of rows with rowcount in the properties form of the table.
The properties form uses the value found in the sysinexes table. this can NOT be guaranteed to be up to date.
if you wish to use this value then you must ensure the sysindexes table is updated...
Viruland,
you need to enclose the date in quotes
try the following changes
1) SET @Query = @Query + ' AND (GeplAfhDatum < ''' + GetDate() + '''))'
2) SET @Query = @Query + ' AND (GeplAfhDatum < ''' + DateAdd("d", 90, GetDate())+ '''))'
Glyndwr
travis,
I've just spotted this article, I have not tried it but it may be what you're looking for
http://www.sqlmag.com/Forums/messageview.cfm?catid=8&threadid=8135
Glyndwr
travis,
I have done a simple mod to the example in BOL (type text and image function into index tetxbox to find]
this shows how to replace a textstrig with another string (oldserver to newserver) it only finds the first occurrence so will need to execute as many times as occurrences
use...
...into #t values(32,'dddsf')
insert into #t values(32,'deesf')
go
update #t set #t.val2 = #t.val2 + ' - ' +cast(val1 as varchar(10))
from (select * from master.dbo.fn_split('32,23,29,23,3',',')) list
where list.value = #t.val1
This is the create function code
SET QUOTED_IDENTIFIER OFF...
rzirpol.
I have obviously misunderstood your question,
do you want the sequence number to be kept between connections?
if so create a table with the batchno in and read this everytime you need to use it and increment when required.
Glyndwr
...int, @end int
as
begin
declare @cnt int
while @start <= @end
begin
exec sp_doBatch (@start)
set @start = @start +1
end
end
create proc sp_doBatch @id in
as
begin
-- your batch ops
insert into myTable1
select @id, tab2.*
from mytable2
where mySelectField = @id
end
Glyndwr
Tessai2003 ,
you can, if you wish query the db using vbscipt, following example will show you , providing you have sufficient db privelegs, you can easily modify this to update values also
Set cn = CreateObject ("adodb.connection")
Set rs = CreateObject...
Waynest,
there aren't arrays as such but there are workarounds
declare @myArray table (id int , myValue char(10))
declare @cnt int
set @cnt = 0
while @cnt < 10
begin
set @cnt = @cnt + 1
insert into @myArray
values(@cnt, cast(@cnt as char(10)))
end
select * from @myArray
Glyndwr
...@list = case when @list is null then vendor
else @list +',' + vendor end
from #tmpvndlst
where opseq = @name
END
insert into #withlist values( @name,@list)
FETCH NEXT FROM list_cursor INTO @name
END
CLOSE list_cursor
DEALLOCATE list_cursor
select * from #withlist...
Chikey,
your sql statement including the union must be a single string
declare @sql varchar(8000)
set @sql = 'select a from tab1 UNION ALL select a from tabb'
Glyndwr
ibethea
try this
declare @item int
declare @text varchar(8000)
declare @tab table (num int)
set @text = '12, 23, 18, 34, 65, 70'
set @item = 1
while @item <>0
begin
set @item = charindex(',',@text)
if @item <> 0
begin
insert into @tab...
andycape
try a group by clause
create table #fruit ( fruit varchar(40), cost money ,tax money)
go
insert into #fruit values ('potatoes', 100,17.5)
insert into #fruit values ('potatoes', 200,35)
insert into #fruit values ('potatoes', 300,52.5)
go
select fruit, sum(cost + tax) 'Total Amount'...
godzuki
are you saying that you have applied sp3 to SQL and the problems have started, or that sql has been running ok with sp3?
if the former you may want to check out the cross database chaining issues with sp3 , otherwise I'm not sure
Robbomobb
I think this does what you want
create table #dbRecoveryModel (dbname sysname , recoverymodel sql_variant)
insert into #dbRecoveryModel exec sp_msforeachdb 'SELECT ''?'' , databasepropertyex(''?'', ''recovery'')'
select * from #dbRecoveryModel
...= @name where tabfile is null
END
FETCH NEXT FROM FileExistCursor INTO @name
END
CLOSE FileExistCursor
DEALLOCATE FileExistCursor
select * from #FileExistList
output :
tabFile file_exists is_directory parent_exists
------------------------------ -----------...
...= @name where tabfile is null
END
FETCH NEXT FROM FileExistCursor INTO @name
END
CLOSE FileExistCursor
DEALLOCATE FileExistCursor
select * from #FileExistList
output :
tabFile file_exists is_directory parent_exists
------------------------------ -----------...
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.