473,740 Members | 10,529 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create a database with one table on the host

I want to create a database with one table on the host.

I can't user SQL Server Management Studio to do it so I guess I have to do
it programmaticall y.

I have in mind that in the session start (or maybe application start would
be better) I'd check to see it the database exists and if not create it.

The problem is that I have no idea how to do that.

Can you point to documentation of maybe show an example of how to do that?
Thanks
Nov 18 '08 #1
10 2597
What is "The Host"?
"AAaron123" <aa*******@road runner.comwrote in message
news:OG******** ******@TK2MSFTN GP04.phx.gbl...
>I want to create a database with one table on the host.

I can't user SQL Server Management Studio to do it so I guess I have to do
it programmaticall y.

I have in mind that in the session start (or maybe application start would
be better) I'd check to see it the database exists and if not create it.

The problem is that I have no idea how to do that.

Can you point to documentation of maybe show an example of how to do that?
Thanks

Nov 18 '08 #2

"sloan" <sl***@ipass.ne twrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
What is "The Host"?
"AAaron123" <aa*******@road runner.comwrote in message
news:OG******** ******@TK2MSFTN GP04.phx.gbl...
>>I want to create a database with one table on the host.

I can't user SQL Server Management Studio to do it so I guess I have to
do it programmaticall y.

I have in mind that in the session start (or maybe application start
would be better) I'd check to see it the database exists and if not
create it.

The problem is that I have no idea how to do that.

Can you point to documentation of maybe show an example of how to do
that?
Thanks

If you have SSMS on your development workstation you can do the following:

Create your database on your test SQL Server.
Create your table on your test SQL Server
Script the database using SSMS (create option)
Script the table using SSMS (create option)

Use those scripts thru ADO.NET to create the database first and then the
table. You will also have to ATTACH the newly created database. Also note
that the script created will have lots of GO's. You will have to execute
each set of commands between the GO's as SQL Server does not know what GO
is.

You might also have to set permissions and ensure that the location of the
database file is valid and accessable by SQL Server.

Hope this helps
LS

Nov 18 '08 #3
Laneware free
"sloan" <sl***@ipass.ne twrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
What is "The Host"?
"AAaron123" <aa*******@road runner.comwrote in message
news:OG******** ******@TK2MSFTN GP04.phx.gbl...
>>I want to create a database with one table on the host.

I can't user SQL Server Management Studio to do it so I guess I have to
do it programmaticall y.

I have in mind that in the session start (or maybe application start
would be better) I'd check to see it the database exists and if not
create it.

The problem is that I have no idea how to do that.

Can you point to documentation of maybe show an example of how to do
that?
Thanks


Nov 18 '08 #4
Wow!

I was expecting that I could programmaticall y connect and then create with a
set of sql commands.
I should have mentioned that I have SQL Server 2008, the host has SQL
Express 2005 ( I have the free service, he has better for payers).

If the SQL Server 2008 script is OK to use on SQL Express 2005 (is it?) can
I just remove the Go's from the script?

Thanks for the info
"Lloyd Sheen" <a@b.cwrote in message
news:Od******** ******@TK2MSFTN GP03.phx.gbl...
>
"sloan" <sl***@ipass.ne twrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
>What is "The Host"?
"AAaron123" <aa*******@road runner.comwrote in message
news:OG******* *******@TK2MSFT NGP04.phx.gbl.. .
>>>I want to create a database with one table on the host.

I can't user SQL Server Management Studio to do it so I guess I have to
do it programmaticall y.

I have in mind that in the session start (or maybe application start
would be better) I'd check to see it the database exists and if not
create it.

The problem is that I have no idea how to do that.

Can you point to documentation of maybe show an example of how to do
that?
Thanks


If you have SSMS on your development workstation you can do the following:

Create your database on your test SQL Server.
Create your table on your test SQL Server
Script the database using SSMS (create option)
Script the table using SSMS (create option)

Use those scripts thru ADO.NET to create the database first and then the
table. You will also have to ATTACH the newly created database. Also
note that the script created will have lots of GO's. You will have to
execute each set of commands between the GO's as SQL Server does not know
what GO is.

You might also have to set permissions and ensure that the location of the
database file is valid and accessable by SQL Server.

Hope this helps
LS

Nov 18 '08 #5
unless you have the admin access to sqlserver you can not create a database.
most likely your isp only allows an autoconnect (via a connection string) to
a database you upload (app_data folder). this means you create the database
locally, disconnect it then upload.

-- bruce (sqlwork.com)
"AAaron123" wrote:
Wow!

I was expecting that I could programmaticall y connect and then create with a
set of sql commands.
I should have mentioned that I have SQL Server 2008, the host has SQL
Express 2005 ( I have the free service, he has better for payers).

If the SQL Server 2008 script is OK to use on SQL Express 2005 (is it?) can
I just remove the Go's from the script?

Thanks for the info
"Lloyd Sheen" <a@b.cwrote in message
news:Od******** ******@TK2MSFTN GP03.phx.gbl...

"sloan" <sl***@ipass.ne twrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
What is "The Host"?
"AAaron123" <aa*******@road runner.comwrote in message
news:OG******** ******@TK2MSFTN GP04.phx.gbl...
I want to create a database with one table on the host.

I can't user SQL Server Management Studio to do it so I guess I have to
do it programmaticall y.

I have in mind that in the session start (or maybe application start
would be better) I'd check to see it the database exists and if not
create it.

The problem is that I have no idea how to do that.

Can you point to documentation of maybe show an example of how to do
that?
Thanks
If you have SSMS on your development workstation you can do the following:

Create your database on your test SQL Server.
Create your table on your test SQL Server
Script the database using SSMS (create option)
Script the table using SSMS (create option)

Use those scripts thru ADO.NET to create the database first and then the
table. You will also have to ATTACH the newly created database. Also
note that the script created will have lots of GO's. You will have to
execute each set of commands between the GO's as SQL Server does not know
what GO is.

You might also have to set permissions and ensure that the location of the
database file is valid and accessable by SQL Server.

Hope this helps
LS


Nov 18 '08 #6
If all you need is one table it is kind of over-kill to even use SQL Server
when one or more XML files can replace the entire notion of using a
database.

For example, write one XML file to contain the "Primary Key" and another XML
file containing the data for each record. You could put all data into a
single file too. Its something to consider...

"AAaron123" <aa*******@road runner.comwrote in message
news:OG******** ******@TK2MSFTN GP04.phx.gbl...
>I want to create a database with one table on the host.

I can't user SQL Server Management Studio to do it so I guess I have to do
it programmaticall y.

I have in mind that in the session start (or maybe application start would
be better) I'd check to see it the database exists and if not create it.

The problem is that I have no idea how to do that.

Can you point to documentation of maybe show an example of how to do that?
Thanks
Nov 18 '08 #7
I'm probably making a mountain out of a mole hill.
All I want to do is maintain a count of how many visitors the site has had.
I've seen others use a database.

Maybe a question as to how to approach this would be a better question.

Thanks
"Hillbilly" <so******@somew here.comwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
If all you need is one table it is kind of over-kill to even use SQL
Server when one or more XML files can replace the entire notion of using a
database.

For example, write one XML file to contain the "Primary Key" and another
XML file containing the data for each record. You could put all data into
a single file too. Its something to consider...

"AAaron123" <aa*******@road runner.comwrote in message
news:OG******** ******@TK2MSFTN GP04.phx.gbl...
>>I want to create a database with one table on the host.

I can't user SQL Server Management Studio to do it so I guess I have to
do it programmaticall y.

I have in mind that in the session start (or maybe application start
would be better) I'd check to see it the database exists and if not
create it.

The problem is that I have no idea how to do that.

Can you point to documentation of maybe show an example of how to do
that?
Thanks

Nov 18 '08 #8
Thanks, I'd have to install sql express 2005 when I have already have sql
server 2008. Not sure if doing that would upset sql server 2008 or vs 2008.
thanks for the info

"bruce barker" <br*********@di scussions.micro soft.comwrote in message
news:1D******** *************** ***********@mic rosoft.com...
unless you have the admin access to sqlserver you can not create a
database.
most likely your isp only allows an autoconnect (via a connection string)
to
a database you upload (app_data folder). this means you create the
database
locally, disconnect it then upload.

-- bruce (sqlwork.com)
"AAaron123" wrote:
>Wow!

I was expecting that I could programmaticall y connect and then create
with a
set of sql commands.
I should have mentioned that I have SQL Server 2008, the host has SQL
Express 2005 ( I have the free service, he has better for payers).

If the SQL Server 2008 script is OK to use on SQL Express 2005 (is it?)
can
I just remove the Go's from the script?

Thanks for the info
"Lloyd Sheen" <a@b.cwrote in message
news:Od******* *******@TK2MSFT NGP03.phx.gbl.. .
>
"sloan" <sl***@ipass.ne twrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
What is "The Host"?
"AAaron123" <aa*******@road runner.comwrote in message
news:OG******* *******@TK2MSFT NGP04.phx.gbl.. .
I want to create a database with one table on the host.

I can't user SQL Server Management Studio to do it so I guess I have
to
do it programmaticall y.

I have in mind that in the session start (or maybe application start
would be better) I'd check to see it the database exists and if not
create it.

The problem is that I have no idea how to do that.

Can you point to documentation of maybe show an example of how to do
that?
Thanks


If you have SSMS on your development workstation you can do the
following:

Create your database on your test SQL Server.
Create your table on your test SQL Server
Script the database using SSMS (create option)
Script the table using SSMS (create option)

Use those scripts thru ADO.NET to create the database first and then
the
table. You will also have to ATTACH the newly created database. Also
note that the script created will have lots of GO's. You will have to
execute each set of commands between the GO's as SQL Server does not
know
what GO is.

You might also have to set permissions and ensure that the location of
the
database file is valid and accessable by SQL Server.

Hope this helps
LS



Nov 18 '08 #9
sqlexpress 2005 and/or sqlserver 2005 will run side by side with
sqlserver 2008. I'd probably just install sqlserver 2005. you want a
version to match your isp. your other option is to use virtual machines.

-- bruce (sqlwork.com)
AAaron123 wrote:
Thanks, I'd have to install sql express 2005 when I have already have sql
server 2008. Not sure if doing that would upset sql server 2008 or vs 2008.
thanks for the info

"bruce barker" <br*********@di scussions.micro soft.comwrote in message
news:1D******** *************** ***********@mic rosoft.com...
>unless you have the admin access to sqlserver you can not create a
database.
most likely your isp only allows an autoconnect (via a connection string)
to
a database you upload (app_data folder). this means you create the
database
locally, disconnect it then upload.

-- bruce (sqlwork.com)
"AAaron123" wrote:
>>Wow!

I was expecting that I could programmaticall y connect and then create
with a
set of sql commands.
I should have mentioned that I have SQL Server 2008, the host has SQL
Express 2005 ( I have the free service, he has better for payers).

If the SQL Server 2008 script is OK to use on SQL Express 2005 (is it?)
can
I just remove the Go's from the script?

Thanks for the info
"Lloyd Sheen" <a@b.cwrote in message
news:Od****** ********@TK2MSF TNGP03.phx.gbl. ..
"sloan" <sl***@ipass.ne twrote in message
news:%2***** ***********@TK2 MSFTNGP05.phx.g bl...
What is "The Host"?
>
>
"AAaron12 3" <aa*******@road runner.comwrote in message
news:OG**** **********@TK2M SFTNGP04.phx.gb l...
>I want to create a database with one table on the host.
>>
>I can't user SQL Server Management Studio to do it so I guess I have
>to
>do it programmaticall y.
>>
>I have in mind that in the session start (or maybe application start
>would be better) I'd check to see it the database exists and if not
>create it.
>>
>The problem is that I have no idea how to do that.
>>
>Can you point to documentation of maybe show an example of how to do
>that?
>>
>>
>Thanks
>>
>
If you have SSMS on your development workstation you can do the
following:

Create your database on your test SQL Server.
Create your table on your test SQL Server
Script the database using SSMS (create option)
Script the table using SSMS (create option)

Use those scripts thru ADO.NET to create the database first and then
the
table. You will also have to ATTACH the newly created database. Also
note that the script created will have lots of GO's. You will have to
execute each set of commands between the GO's as SQL Server does not
know
what GO is.

You might also have to set permissions and ensure that the location of
the
database file is valid and accessable by SQL Server.

Hope this helps
LS


Nov 19 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1815
by: joshsackett | last post by:
Given the following table information: HOSTNAME DATETIME WEBNYC001 2005-06-15 10:30AM WEBNYC001 2005-06-15 10:31AM WEBNYC001 2005-06-15 10:31AM WEBNYC001 2005-06-15 10:34AM WEBNYC001 2005-06-15 10:35AM WEBNYC001 2005-06-15 10:35AM WEBNYC002 2005-06-15 10:30AM
5
3274
by: Frank van Vugt | last post by:
Hi, I noticed that when using the single commandline: drop database <name>; create database <name>; this sometimes fails due to a pg_autovacuum process running on the background. When this happens, the error returned is:
1
4087
by: Jim | last post by:
Hi, I want to add a field to a table in a database that is live and being accessed from the web. I'm using phpMyAdmin and when I try to add the field I get error #1142 (ER_TABLEACCESS_DENIED_ERROR) "ALTER command denied to user 'xxx' for table 'yyy'" I'm a newbie to MySQL but I guess that's a reasonable error as there are probably open connections. If that is the reason, is there a way I can force all connections to close and not...
3
2304
by: fritz-bayer | last post by:
Hi, is it possible to create remote virtual tables in mysql? By that I mean if it is possible to define a table, which actually resides on a remote mysql server, but which can be accessed and addressed as if the table would be on the local database. My intention is to move one table to a remote host, but to be able to address the table as if it was still on the same machine.
3
2850
by: Bob Bedford | last post by:
hello I'm looking for some functions or objects allowing to select-insert-update-delete from any table in a mysql database without the need to create a new query every time. Example: selectdatas(array('field1','field2','fieldn'),array('table1','tablen'),array('left join,idy','inner join, idx')) then the function build the query, execute it and then return an object with
4
5641
by: jeffreywgraham | last post by:
A word of warning, I am new to .NET and fairly new to SQL Server. The problem I have must be a common one, but I am uable to make it work. I have a .NET project and have the user management and roles working fine via Visual Studio and the default "ASPNewSQlMembershipProvider." There is database file called "ASPNETDB ..MDF", and users are easily created and logged in. I can access the tables fine. Now I just need to upload the...
14
6136
by: mistral | last post by:
Need php script to create mySQL database programmatically; since hosting configuration may not allow create database from script, script also need eliminate/rewrite all restrictions in appropriate places in that hosting.
4
4082
tolkienarda
by: tolkienarda | last post by:
Hi all I work for a small webdesign company and we have remote hosting. i built a mysql database with phpmyadmin on the server. i then downloaded and modified a php login page. i am continuing to get the ---invalid username or password--- i am not getting the E_USER_ERROR so i don't know if there is a problem with the php, how i set up the database or mabe somthing in between. so everyone knows all of my server interface is GUI. I use a company...
4
12440
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
0
8794
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9484
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9342
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6756
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6056
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4572
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3286
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2195
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.