Viewing 15 posts - 18,136 through 18,150 (of 18,923 total)
Here's something that can help you :
bcp pubs..authors2 in authors.txt -c -t, -Sservername -Usa -Ppassword -h "CHECK_CONSTRAINTS"
BULK INSERT pubs..authors2 FROM 'c:\authors.txt'
WITH (
DATAFILETYPE = 'char',
...
April 13, 2005 at 8:42 am
I would also suggest that you start using the best practice of naming the columns in the insert statement :
Insert into dbo.MyTable (col1, col2, coln) select col1, col2, coln...
April 13, 2005 at 8:32 am
Delete from dbo.YourTable where DateCol < DateAdd(m, -18, getdate())
You can then run this in a job whenever you need (just schedule de job to run whenever necessary).
April 13, 2005 at 7:58 am
R u using a bulk insert statement or just standard sql query?
April 13, 2005 at 7:03 am
Actually UNION ALL doesn't remove dups, it's UNION that does that.
April 13, 2005 at 6:50 am
"LogFilePath.log", ForAppending, True /*create if not exists*/
the 3rd parameter set to true means the the file will be created if it doesn't exists. So you don't need to do...
April 13, 2005 at 6:47 am
This is an exemple of how this trick can be converted to a function and then used in a select statement. But I agree with Kenneth that said that...
April 13, 2005 at 6:32 am
You set the variable @Job to an empty string, then you concatenate all the values that the select will return into that variable, then you can print/return/select the variable.
April 13, 2005 at 6:22 am
no because when it is first evaluated, it is greater than 0, the value is reset after the if is evaluated.
@MyRowcount is a different variable kept in another part of...
April 12, 2005 at 2:00 pm
That's a nice touch Noeld... but I think that the problems comes from the 50 delete statements that don't use any clustered indexes to do the deletes.. resulting in way...
April 12, 2005 at 1:39 pm
This could be cut to subsecond if you want my opinion.
Is this what's going on??
You have a live table where the info is kept.
You have a staging table where new/updated...
April 12, 2005 at 1:33 pm
run this in Query analyser and you'll see the problem
Select top 1 * from dbo.SysObjects
Print @@Rowcount
--1
print @@Rowcount
--0
The rowcount variable is reupdated after the print statement. The 2nd time you...
April 12, 2005 at 1:21 pm
Thank god... I was hopping he was wrong cause a few of my backups would have been wrong :-).
April 12, 2005 at 12:10 pm
The table is created then dropped within the exec () statement
try :
set @sql = 'select * into #mytemp from ;
SELECT * FROM #mytemp'
exec (@sql)
April 12, 2005 at 12:09 pm
Viewing 15 posts - 18,136 through 18,150 (of 18,923 total)