Showing posts with label install. Show all posts
Showing posts with label install. Show all posts

Wednesday, March 21, 2012

Create SQL Server Objects from Command Prompts

Hi

Is there any why to Create SQL Server Objects from Command Prompts like (Databases , Tables, Stored Procedures, …) ??

If you will Install some Applications Like this forums you will see the SQL Server object Created from Command Prompts

How Can I do that .. ??

And thanks with my regarding

FraasHave a look at OSQL in SQL Server BOL

Create SQL install script

I want to create a SQL script like the one for Northwind... that creates the DB with data (instnwnd.sql).

I have the DB running I just don't know how to add all the tables and content into a file.

In mySQL I would just use phpmy admin to create the scipt... just don't know how in MS SQL.

Any help is greatly appreciated.

If you got an existing database to can just right click the mouse in MS SQL 2005 and generate the sql script, you can put in in the clipboard or on a script.sql file.

Do you have MS SQL 2005? 2000 or express?

|||

I have 2005... I have tried to do that but I only get the tables and not the data.

Thanks!

|||

AH!

If you want the data, you'll have to Export and you can still select a file or another database.

|||

Doh... I was in SQL Express. I also have SQL 2005. I know see it...

Thanks!

|||

Well, it's Saturday, minds are a little confused on SaturdaysWink

|||

Here is article that describes the way it could be made.http://www.denovations.com/articles/

Unfortunately there is no standard way to do it.

Create script to insert 200 rows into table

I have to create a script to install a database, and one of the tables
has about 200 rows of static data... I dont want to have to manually
type in 200 insert statements, so is there a better way to do this? I
thought about maybe exporting the data into a CSV file and using some
sort of procedure to insert the records that way... Any advise?I did some research and discovered the lovely BCP utility. With this
utility i was able to export the data into a basic txt file using this
as a template:

bcp "SELECT * FROM pubs..authors" queryout authors.txt -U garth -P pw -
c

However I can find any resources on how I would go about putting the
data into the table...
If anyone could please use the above example, as the export and
provide me with a proper import that would be absolutely wonderful.|||I figured out that I can just include a bulk insert statement in my
script to do this::

BULK INSERT tmpStList FROM 'c:\TxtFile2.txt' WITH (FIELDTERMINATOR =
',')

however I can't figure out how to use a tab as the field terminator as
opposed to ,|||Well, all I did was change the bcp utility to create a CSV file
instead of the tab seperated file...

But when I try to run the bulk insert statement I get this error:

The BULK INSERT SQL construct or statement is not supported.

Error Message:

Cannont bulk load because the file "C:\scripts\attributes.txt" could
not be opened. Operating system error code 123(The filename,
directory name, or volume lable syntax is incorrect.)|||Perhaps you ran the BCP utility locally, then ran BULK INSERT on the
server?

Have you noticed yet that BCP works in both directions, IN as well as
OUT?

Roy Harvey
Beacon Falls, CT

On Wed, 15 Aug 2007 16:30:22 -0000, rhaazy <rhaazy@.gmail.comwrote:

Quote:

Originally Posted by

>Well, all I did was change the bcp utility to create a CSV file
>instead of the tab seperated file...
>
>But when I try to run the bulk insert statement I get this error:
>
>The BULK INSERT SQL construct or statement is not supported.
>
>
>Error Message:
>
>Cannont bulk load because the file "C:\scripts\attributes.txt" could
>not be opened. Operating system error code 123(The filename,
>directory name, or volume lable syntax is incorrect.)

|||My problem was that I was using the wrong instance of sql server...I
was trying to use sql server express, which doesn't support the bulk
insert. After I changed the instance I had no problem getting it to
work. Thanks for your response though.|||SQL Script Builder is a multiple platform database migration tool, it
create a database sql script (or dump file) from any ODBC data source.
Scripts are available in 5 output formats ; MySql, MS SQL, Oracle,
Pervasive and PostgreSQL. The script produced will migrate the
database (multiple tables selection) or only one table. SQL Script
Builder can be used for example to migrate your Access database to
MySql database, or MySql database to MS SQL database and vice
versa.There's no limits, all you need is the ODBC driver for the
database you wish to import from.

More Info: http://www.sqlscriptbuilder.com
Download URL: http://www.sqlscriptbuilder.com/dow...uildersetup.exe
Screenshot URL: http://www.sqlscriptbuilder.com/images/Interface.jpg
Best regards,
David

Thursday, March 8, 2012

Create New SQL Server Mobile Edition Database

Hi, I follow the instruction to install SQL Server 2005 Mobile Edition, but when I try to change the Data Source to add a new connection, I don't find "Create New SQL Server Mobile Edition Database".
Does anyone know how to fix this?

Thanks Paolo GiorgioThe following steps should give you a brand new Sql Mobile database

- Go to the new connection dialog. Quickest way is to right click on Data Connections in the Server Explorer and choosing to add a connection

- Make sure you have the Sql Mobile provider selected. The full name is "Microsoft SQL Server Mobile Edition (.NET Framework Data Provider for SQL Server CE)"

- Now you should see a 'Create' button which will let you create a new Sql Mobile database|||

I just follow your step, but when i have to choose the Sql Mobile provider, "Microsoft SQL Server Mobile Edition" is not available, evenif i installed .Net compact framework for Sql Mobile.

|||Do you see Sql Mobile in your Add/Remove programs list?|||Which Program List?|||In your Control Panel->Add or Remove programs, do you see an entry which says "Microsoft Sql Server 2005 Mobile [ENU] Developer Tools"?|||No i don't find in the List.
I find only "Microsoft Sql Server 2005 Mobile [ENU] Beta 3".|||I try to find "Microsoft Sql Server 2005 Mobile [ENU] Developer Tools" by Google but i don't find anything|||

In the early beta days of "Microsoft SQL Server 2005 Mobile [ENU] Developer Tools" was registered as "Microsoft SQL Server 2005 Mobile [ENU] Beta 3".

If you have uninstalled and reinstalled .NET Fx after VS Installation, this problem would arise. Can you please search for Data Providers in .NET Framework config file.

%SystemDrive%\WINDOWS\Microsoft.NET\Framework\v2.0.xxxxx\config\machine.config

Open this file in NOTEPAD, and search for "SQL Server CE Data Provider". If it is not there then, you may try adding the following line AS IT IS in Data Providers section.

<add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

You may need to restart the VS or even the PC to make VS detect this new setting.

Let us know if this has worked for you!

Thanks,
Laxmi NRO, SQL Mobile

|||

Thank you, but it still not working.
We follow your instruction, reboot the PC, but the Dataprovider still not in the list of the Data Sources.

Any other solution?
Thanks,
Paolo Giorgio

|||DEVTOOLS ==> Microsoft SQL Server 2005 Mobile [ENU] Beta 3 or Microsoft SQL Server 2005 Mobile [ENU] Developer Tools

Uninstall & Reinstall DEVTOOLS using the MSI sqlmobile30devtoolsenu.msi in wcu\SQLCE sub directory of your Whidbey Installation Disc.

Goto ADD/REMOVE programs to uninstall DEVTOOLS.

Thanks,
Laxmi NRO, MSFT, SQL Mobile, Microsoft Corporation

Create New SQL Server Mobile Edition Database

Hi, I follow the instruction to install SQL Server 2005 Mobile Edition, but when I try to change the Data Source to add a new connection, I don't find "Create New SQL Server Mobile Edition Database".
Does anyone know how to fix this?

Thanks Paolo GiorgioThe following steps should give you a brand new Sql Mobile database

- Go to the new connection dialog. Quickest way is to right click on Data Connections in the Server Explorer and choosing to add a connection

- Make sure you have the Sql Mobile provider selected. The full name is "Microsoft SQL Server Mobile Edition (.NET Framework Data Provider for SQL Server CE)"

- Now you should see a 'Create' button which will let you create a new Sql Mobile database|||

I just follow your step, but when i have to choose the Sql Mobile provider, "Microsoft SQL Server Mobile Edition" is not available, evenif i installed .Net compact framework for Sql Mobile.

|||Do you see Sql Mobile in your Add/Remove programs list?|||Which Program List?|||In your Control Panel->Add or Remove programs, do you see an entry which says "Microsoft Sql Server 2005 Mobile [ENU] Developer Tools"?|||No i don't find in the List.
I find only "Microsoft Sql Server 2005 Mobile [ENU] Beta 3".|||I try to find "Microsoft Sql Server 2005 Mobile [ENU] Developer Tools" by Google but i don't find anything|||

In the early beta days of "Microsoft SQL Server 2005 Mobile [ENU] Developer Tools" was registered as "Microsoft SQL Server 2005 Mobile [ENU] Beta 3".

If you have uninstalled and reinstalled .NET Fx after VS Installation, this problem would arise. Can you please search for Data Providers in .NET Framework config file.

%SystemDrive%\WINDOWS\Microsoft.NET\Framework\v2.0.xxxxx\config\machine.config

Open this file in NOTEPAD, and search for "SQL Server CE Data Provider". If it is not there then, you may try adding the following line AS IT IS in Data Providers section.

<add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

You may need to restart the VS or even the PC to make VS detect this new setting.

Let us know if this has worked for you!

Thanks,
Laxmi NRO, SQL Mobile

|||

Thank you, but it still not working.
We follow your instruction, reboot the PC, but the Dataprovider still not in the list of the Data Sources.

Any other solution?
Thanks,
Paolo Giorgio

|||DEVTOOLS ==> Microsoft SQL Server 2005 Mobile [ENU] Beta 3 or Microsoft SQL Server 2005 Mobile [ENU] Developer Tools

Uninstall & Reinstall DEVTOOLS using the MSI sqlmobile30devtoolsenu.msi in wcu\SQLCE sub directory of your Whidbey Installation Disc.

Goto ADD/REMOVE programs to uninstall DEVTOOLS.

Thanks,
Laxmi NRO, MSFT, SQL Mobile, Microsoft Corporation