Monday, April 1, 2013

[SQL Server] importing an excel file

[SQL Server] importing an excel file


importing an excel file

Posted: 01 Apr 2013 12:29 PM PDT

hi professionals.I am trying to import and excel spreadhseet into the database by right clicking the database, tasks, import. I chosen excel as the source and went through the wizard.It goes through all the tasksInitilizing data flow,successInitilizing connections,successSetting SQL command,successSetting source connection,successSetting destination connection,successvalidating,successprepare for execute,successpre-execute,successexecuting,sucesscopy to dbo.SofUseComp (It hangs here)Post executeIt hangs on the copy part of the import wizard, any ideas where I can look to see whats going on. I have imported small files without any problem.This spreadsheet has ten columns and 1,048.576 rowsthanks everyone in advance

query to find timgaps between rows

Posted: 01 Apr 2013 06:52 AM PDT

Basically I want missing timegaps between the @startdate and @enddatewith tbl_book and also in between tbl_book (do not care about the bookid column in the resultset)---------------------------------CREATE TABLE [dbo].[book]( [bookid] [int] IDENTITY(1,1), [starttime] [datetime] NULL, [endtime] [datetime] NULL) ON [PRIMARY]GOINSERT INTO [dbo].[book] ('2013-03-05 16:30:00.000','2013-03-05 16:45:00.000')INSERT INTO [dbo].[book] ('2013-03-05 17:30:00.000','2013-03-05 17:45:00.000') declare @startdate datetime set @startdate='2013-03-05 16:00:00.000' declare @enddate datetime set @enddate='2013-03-05 19:00:00.000'; Resultset may look like:AvailableStart_time AvailableEnd_time---------------------- ----------------------------2013-03-05 16:00:00.000 2013-03-05 16:30:00.0002013-03-05 16:45:00.000 2013-03-05 17:30:00.0002013-03-05 17:45:00.000 2012-03-05 19:00:00.000

on primary

Posted: 31 Mar 2013 10:36 PM PDT

why [b]on primary [/b] is used while creating a table is it necessaryex:create table temp(name varchar(50),age smallint,salary int)[b]on primary[/b]

No comments:

Post a Comment

Search This Blog