Showing posts with label express. Show all posts
Showing posts with label express. Show all posts

Thursday, March 22, 2012

Exporting Data from excel to SQL Server express

Hi

I have managed to add the DTS wizard as a tool and saved the routine. However, I do not know how to schedule my PC to automatically run this DTS procedure. I have tried to use scheduled tasks, but it does not seem to want to start.

Pls help.

It was absolutely amazing.

Just by typing in "SQL Server" and Excel in the search box on this page in the forums, I found these previous posting on the same topic...

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1083746&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=295895&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=970723&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=304674&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=985930&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1083317&SiteID=1

There were more...

|||

Hi Arnie,

Thanks for the suggestion, I discovered a a previous post you made. You suggested that you get scheduled tasks to run dtsrun.exe. I do not have DTSrun.exe and surely you would have to make the executable run only your specified saved DTS 'routines'. How would you do this?

Regards

George

|||

Perhaps these will help guide you.

DTS - How to Run a DTS Package as a Scheduled Job
http://www.support.microsoft.com/?id=269074

DTSWizard.exe
http://go.microsoft.com/fwlink/?LinkId=65111

|||

Hi

Thank you for your help, but unfortunately the above solutions do not seem to work. Let me explain my situation more completely:

I have installed Microsoft SQL Server Express Edition with Advanced Services SP2 and the Toolkit. I have made the DTSWizard a tool in SQL management studio express I have transferred sample data into the database using the DTS tool. I have 'saved' the DTS transfer|||

For command line details about executing a 'package', refer to Books Online, Topic: dtutil

Wednesday, March 21, 2012

Exporting a table to Excel using bcl utility (Newbie)

I am trying to learn SQL 2005 Express and I am having a problem exporting (if that is the correct word) a table to Excel.

I have created a view in the Northwind database called MyCustomerView and want to practice working with the table.

From the command prompt:

bcp Northwind.dbo.MyCustomerView out MCV.xls -S -T

I then get the error message:

c:\> bcp Northwind.dbo.MyCustomerView out MCV.xls -S -T

SQLState = 08001, NativeError = 10061

Error = [Microsoft][SQL Native Client]TCP Provider: No connection could be made because the target machine actively refused it.

SQLState = HYT00, NativeError = 0

Error = [Microsoft][SQL Native Client]Login timeout expired

SQLState = 08001, NativeError = 10061

Error = [Microsoft][SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.

This is on a single machine running Widows XP Home.

Help Please

Did you enable remote connections on the SQL Server express machine ? See the Screencast on my site for more information and a walkthrough. Do you have SQL Browser started ? SQL Server will pick a port to bind it to the service. If SQL Browser is not started you will have to specify it within the server declaration. If started it will directly redirect you to the appropiate instance.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||

Thanks Jens

Everything you suggested I have tried, but am still getting the errors.

Exporting a table to a file -reg

Dear Friends,
I am having Sql Server 2005 Express Edition. Also I have installed "Sql
Server Management Studio Express".
In "Sql Server Management Studio Express", how to export a table to a csv
file, or to another table?
Thanks & Regards,
Thirumalai.Hi
Use AdventureWorks
--Import to another table
SELECT * INTO Person.Address_New FROM
Person.Address
SELECT * FROM Person.Address_New
--Import to the file
exec master..xp_cmdshell 'BCP AdventureWorks.Person.Address_New OUT
c:\test1.txt -c -C850 -SSERVER\SQLSERVERDEV2005 -Usa -Ppwd'
"Thirumalai" <thirumalai@.cspl.com> wrote in message
news:eiQpaM$SGHA.4452@.TK2MSFTNGP12.phx.gbl...
> Dear Friends,
> I am having Sql Server 2005 Express Edition. Also I have installed "Sql
> Server Management Studio Express".
> In "Sql Server Management Studio Express", how to export a table to a csv
> file, or to another table?
> Thanks & Regards,
> Thirumalai.
>
>

Sunday, February 19, 2012

Export to a Text file in SQL Server Express

I have a table in a database has the same filed with a text file:

RBW_AR_BOT_REC

Size

Comment

Justification

Padding

record_id

1

'R'

None

None

date

6

MMDDYY

None

None

time

4

HHMM

(24 hour time)

None

None

cust_num

8

1

- 9999999

Right

Zero

odometer

6

0

- 999999

Right

Zero

receipt

8

1

- 99999999

Right

Zero

exception_customer

1

'0' = No

'1' = Yes

None

None

valid_void

1

'0' = valid

'v' = void

None

None





Justification

Padding






None

None

So that, after export data from the table, the file file must has that struct
Tell me, how can i do?





None

None






None

None






Right

Zero






Right

Zero






Right

Zero






None

None






None

None





Justification

Padding






None

None






None

None






None

None






Right

Zero






Right

Zero






Right

Zero






None

None






None

None

I am going to move this to the sql express group at it is more a problem with using the software.

On another note, you can use the management studio for the express systems (Free Download) and have the query saved or displayed as text, or you could format up the sql script and then use the sqlcmd command line tool to execute that command and save the output as text. But with the information you supplied we are going to need more information, for exable an definition of the table and if you could format the output sample better in the forums message so it is easily read.

|||

hi,

there's no direct way to "export" to file in a defined format like old style random access files...

you can query a table object to return what you are looking for, but the export features are usually performed a client level (thus via an external application) and not at the server level..

you can perhaps use SqlCMD.exe (or oSql.exe), the command line (not graphics tools) provided with SQLExpress, providing the "-oc:\myfile.txt" parameter (-o indicates to output the result to the specified file) (more info and synopsis about SQLCmd at http://msdn2.microsoft.com/en-us/library/ms162773.aspx)... and play with some Transact-SQL function to obtain something similar to the required result..

say you are querying the AdventureWorks database for Person.Address table and you want to return the

[AddressID] (int) formatted as right padded 6 chars and the [ModifiedDate] (datetime) formatted with the yyyy-mm-dd (without time dimension) 8 chars values...

the typical query could be

SET NOCOUNT ON;

USE AdventureWorks;

GO

SELECT RIGHT(REPLICATE(' ' , 6) + CONVERT(varchar, AddressID), 6 ) AS AddressID,

CONVERT(varchar(10), ModifiedDate, 121) AS ModifiedDate

FROM Person.Address

ORDER BY ModifiedDate;

--<--

AddressID ModifiedDate
61 1996-07-24

234 1997-02-19

224 1997-12-05

11387 1997-12-29

1997-12-29

( result abridged )

and want the results to be output to c:\myRes.txt..

create a file to store your query like

<c:\myQuery>
SELECT RIGHT(REPLICATE(' ' , 6) + CONVERT(varchar, AddressID), 6 ) AS AddressID,
CONVERT(varchar(10), ModifiedDate, 121) AS ModifiedDate
FROM Person.Address
ORDER BY ModifiedDate;
</c:\myQuery>

and execute, from the command line, the SQLCmd utility like

c:\..\>sqlcmd -E -S(Local)\SQLExpress -dAdventureWorks -iC:\myQuery -oC:\myRes.txt

this will output the result as

AddressID ModifiedDate
61 1996-07-24

234 1997-02-19

224 1997-12-05

11387 1997-12-29

1 1998-01-04

( result abridged )

you can play with the other SQLCmd parameters as wel, like -h for repeted headers, -s for col separator and the like...

regards

Friday, February 17, 2012

Export table content to sql script

Is it possible in SQL express and SQL server mangement studio express to export table content to sql script, like form table

column1 column2
1 2 2
2 3 34
3 4 234

we get script

INSERT INTO [database].[dbo].[table] ([column1] ,[column2]) VALUES (2,2)

INSERT INTO [database].[dbo].[table] ([column1] ,[column2]) VALUES (3,34)

INSERT INTO [database].[dbo].[table] ([column1] ,[column2]) VALUES (4,234)

?

If it is not possible in express editions, is it at least available in developer editions?

Have a look here: http://vyaskn.tripod.com/code.htm#inserts

HTH, Jens SUessmeyer.

http://www.sqlserver2005.de

export SQLExpress2005 to Access/Excel?

it seems that the SQLExpress2005 Management Studio Express has no DTS
functionality ... is there a way to automatically export an SQLExpress2005
database (or parts of it) to Access and/or Excel ?
thanks
-Michael
hi Michael,
Michael Peters wrote:
> it seems that the SQLExpress2005 Management Studio Express has no DTS
> functionality ... is there a way to automatically export an
> SQLExpress2005 database (or parts of it) to Access and/or Excel ?
>
not directly, but if you have and already created Access database or Excel
file, you can import/export via linked server,
http://msdn2.microsoft.com/en-us/library/ms190479.aspx
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.16.0 - DbaMgr ver 0.61.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

Export SQL Server to a comma delimited file

Hi,

I'm trying to deploy my Web site to GoDaddy. They told me I have to export the SQL Server Express database to a comma delimited file and then upload that file. The export procedure is simple in Access but I don't see any way to do it in SQL Server or from Visual Web Developer or Visual Studio.

Also, I can ask them, but I assume I have to export each table separately and also export the ASPNETDB as well.

Thanks for the help

Open SQL Management Studio express edition [if not installed then down load and install the same ] , use import export wizard to export to a flat file

|||

Thanks Rmaiya,

I downloaded the SQL Management Studio. I think I now need to learn how to use it. I can't seem to open my database. When I go to Open I get "there is no editor available for D:\myfolder\app_data\mydatabase.mdf. Make sure the application for the file type (.mdf) is installed." Also, where do you find the import export wizzard?

I'll try reading the Help instructions tomorrow.

Export sql server express 2005 to 2000

Hi,

I"m trying to export a databse from my express 2005 to 2000 and I tried using managment studio and doesn't seem to work.

Can anybody give me some tips or links that teach me how to do that? I googled around , so far, havne't found a good solution yet.

Thanks

Hi,

How did you perform the exporting? And what's the error message as it didn't work? Or just no data had been transfered?

I managed to export data from SQL2005 database to SQL2000 in this way:

1. Open Management Studio, explore 'Databases'->right click 'Mydb'

2. Choose 'Tasks'->'Export data', and follow the steps in 'Import and Export Wizard'.

Export SQL Server 2005 Express to SQL Server 2000

I'm trying to export a SQL Server 2005 Express database to SQL Server 2000 sp4, but have so far been unsuccessful. SQL 2005 Express doesn't have an Export Data function and backup/restore doesn't work because of the different versions.

Any suggestions greatly appreciated!

I dont think you can move dbs from higher version to lower.....you cannot perform backup/restore nor detach/attach.......the same applies to sql 2005 to sql 2000

|||

Well, Deepak is right, you will have to use the Import functionality of SQL Server 200 to get the data from the 2k5 to the 2k database.

Jens K. Suessmeyer

http://www.sqlserver2005.de