Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 deleting first row

Author  Topic 

pmccann1
Posting Yak Master

107 Posts

Posted - 2006-09-12 : 10:10:05
i am using an update query and brining in a table to another table however the first row contains the filed names is there a way of deleting the first row with out hard coding it

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2006-09-12 : 10:15:55
Use DTS, and you can skip the first row with a simple check box that says "First row has column names".

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-09-12 : 10:16:41
If the first row contains the fieldnames, the chance that the update query will match that row is very slim, so I wouldn't bother about it.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-09-12 : 10:17:53
This is a sequel to this topic http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=71821

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-09-12 : 10:25:42
[code]declare @path varchar(100), @sqlcmd varchar(1000)
select @path = '''\\Arkclient4\c$\Arkitex\Logviewer\Logs\Logview_060910.csv'''

create table #temp (a varchar(255), b varchar(255),c varchar(255),
d varchar(255), e varchar(255),f varchar(255),g varchar(255),
h varchar(255), i varchar(255), j varchar(255),k varchar(255), l varchar(255))

select @sqlcmd = '
BULK INSERT #Temp
FROM ' + @path + '
WITH
(
FIELDTERMINATOR = '','',
ROWTERMINATOR = ''\n'',
FIRSTROW = 2
)'
exec (@sqlcmd)[/code]
Peter Larsson
Helsingborg, Sweden
Go to Top of Page

pmccann1
Posting Yak Master

107 Posts

Posted - 2006-09-12 : 10:27:04
fantastic thank you
Go to Top of Page
   

- Advertisement -