[dba-SQLServer] Delete first record

jwcolby jwcolby at colbyconsulting.com
Mon Jun 8 09:03:35 CDT 2009


 > delete from mytable where pk = 'PK'

ROTFL.  Duh!

Thanks,

John W. Colby
www.ColbyConsulting.com


Francisco Tapia wrote:
> if your field labels are always at pkid 1, you'd want to just say
> 
> delete from mytable
> where pkid = 1
> 
> -Francisco
> http://sqlthis.blogspot.com | Tsql and More...
> 
> 
> On Mon, Jun 8, 2009 at 6:16 AM, jwcolby <jwcolby at colbyconsulting.com> wrote:
> 
>> Is there any way to delete the first record in a table in SQL Server.  I am
>> importing a csv file
>> into a temp table, and from there appending the data to a permanent table.
>>  The csv has the field
>> names in the first row.  When I try to append to the permanent table the
>> append fails because the
>> row name fields aren't the correct data types, thus I need to just delete
>> that first row.
>>
>> --
>> John W. Colby
>> www.ColbyConsulting.com
>> _______________________________________________
>> dba-SQLServer mailing list
>> dba-SQLServer at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
>> http://www.databaseadvisors.com
>>
>>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
> 
> 



More information about the dba-SQLServer mailing list