Viewing 15 posts - 3,601 through 3,615 (of 5,103 total)
use dynamic sql ex:
declare @cmd as varchar(400)
set @cmd = 'BACKUP DATABASE testdb TO DISK = ''E:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\Daily\testdb' +Right(convert(char(6),getdate(),12),4) +'.bak'''
exec ( @cmd)
June 22, 2005 at 2:02 pm
is something like:
select fld1, fld2, sum(*)
from table
group by fld1, Left(fld2,4)
??
June 22, 2005 at 1:57 pm
this is why you find places where sp_rename is not allowed ![]()
either use drop/create or some third party tool
June 22, 2005 at 1:46 pm
It is FREELY available no need for subscription to download the beta anymore ![]()
June 22, 2005 at 1:43 pm
precisely!
June 22, 2005 at 1:18 pm
Yep,
When a man is shown how to use a hammer, suddenly all problems look like nails ![]()
June 22, 2005 at 12:57 pm
>> SQL programmers do not look for functions; <<
Can you tell me, what do you call?
LEN
SUBSTRING
REPLACE
all in your code...
June 22, 2005 at 9:37 am
Not sure If would have been able neither I felt very skeptical of the brute force method but Vasc proof me wrong!
I...
June 22, 2005 at 9:19 am
you could drop it and then recreated with the new columns
or
create index idx_Name on Tablename ( ColA ) with drop_existing --keep same index name
June 21, 2005 at 3:34 pm
I think that you either mak it faster as it was already proposed or encapsulate that logic on a stored proc and call it from a job if at all...
June 21, 2005 at 3:25 pm
>>I ll check the post tommorrow cause this can be done without RECURSIVITY<<
That, is a smart move ![]()
June 21, 2005 at 3:21 pm
goving as the function was written recursively on each iteration @MyNumb will have a different value. I think that those steps have to remain where I see the logic...
June 21, 2005 at 1:44 pm
Good Job!!!
--Check this :
CREATE FUNCTION [dbo].[RecursiveValues]
(
@Pos int,
@MyNumb int
)
RETURNS varchar(400)
AS
BEGIN
DECLARE @TempResult varchar(400)
DECLARE @MinValue int
DECLARE @NewValue int
SELECT @MinValue=SUM(Value) FROM MyTable WHERE Col<@Pos
IF @MyNumb>@MinValue RETURN ''
--check to see if a number...
June 21, 2005 at 1:24 pm
I could guess a bit but to really do the rewrite I would need the DDL for the tables
The update will the same join than the insert exept that it...
June 21, 2005 at 12:59 pm
Viewing 15 posts - 3,601 through 3,615 (of 5,103 total)