Wednesday, March 21, 2012

run sql script on sql server2000

dear all i am using ASP.net ,c# and SQL server 2000. i have create all
table, stored procedure .views in my application which is running well
in localhost but now i want to deploy it on server. for that pupose i
need to create all table, stored procedure, views on the domain server
database. can any one tell me how i can do it?
Do you have the DDL in script files? Or do you just want to transfer the database on your local
database as is to the server?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"santosh" <Santoshmshinde_it@.yahoo.com> wrote in message
news:1159607442.786501.105340@.e3g2000cwe.googlegro ups.com...
> dear all i am using ASP.net ,c# and SQL server 2000. i have create all
> table, stored procedure .views in my application which is running well
> in localhost but now i want to deploy it on server. for that pupose i
> need to create all table, stored procedure, views on the domain server
> database. can any one tell me how i can do it?
>
|||Hi,
Easy option is :-
1. Backup the database in your machine [Use Backup Database]
2. Copy the backup file to Domain server
3. Restore the database [Use Restore Database command]
4. If you do not want the data then Truncate the contents of all tables.
follow the parent chld relationship
while truncating table.
Alternative is ... In the local sql server .. open enterprise manager..
Select database .. right click-- all tasks-- Generate SQL Scripts...
choose all objects , all dependant objects -- permissions...Script it as a
SQL file. Then you could use this script to create
objects in Domain sql server.
Thanks
Hari
SQL Server MVP
"santosh" <Santoshmshinde_it@.yahoo.com> wrote in message
news:1159607442.786501.105340@.e3g2000cwe.googlegro ups.com...
> dear all i am using ASP.net ,c# and SQL server 2000. i have create all
> table, stored procedure .views in my application which is running well
> in localhost but now i want to deploy it on server. for that pupose i
> is
> need to create all table, stored procedure, views on the domain server
> database. can any one tell me how i can do it?
>
|||but i am not having access of enterprise manager of domain server. i
need to run it only programatically.
Hari Prasad wrote:[vbcol=seagreen]
> Hi,
> Easy option is :-
> 1. Backup the database in your machine [Use Backup Database]
> 2. Copy the backup file to Domain server
> 3. Restore the database [Use Restore Database command]
> 4. If you do not want the data then Truncate the contents of all tables.
> follow the parent chld relationship
> while truncating table.
> Alternative is ... In the local sql server .. open enterprise manager..
> Select database .. right click-- all tasks-- Generate SQL Scripts...
> choose all objects , all dependant objects -- permissions...Script it as a
> SQL file. Then you could use this script to create
> objects in Domain sql server.
>
> Thanks
> Hari
> SQL Server MVP
>
> "santosh" <Santoshmshinde_it@.yahoo.com> wrote in message
> news:1159607442.786501.105340@.e3g2000cwe.googlegro ups.com...
|||> but i am not having access of enterprise manager of domain server. i
> need to run it only programatically.
From what programming language?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"santosh" <Santoshmshinde_it@.yahoo.com> wrote in message
news:1159939062.047937.268110@.k70g2000cwa.googlegr oups.com...
> but i am not having access of enterprise manager of domain server. i
> need to run it only programatically.
> Hari Prasad wrote:
>
|||In asp.net using C#.net
Tibor Karaszi wrote:[vbcol=seagreen]
> From what programming language?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "santosh" <Santoshmshinde_it@.yahoo.com> wrote in message
> news:1159939062.047937.268110@.k70g2000cwa.googlegr oups.com...
|||Read the file from your code, take the SQL from the file you read and put it in a command object.
Whenever you reach GO in the script file, execute what you have in the command object using
ExecuteNonQuery.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"santosh" <Santoshmshinde_it@.yahoo.com> wrote in message
news:1160023668.433979.75200@.i42g2000cwa.googlegro ups.com...
> In asp.net using C#.net
> Tibor Karaszi wrote:
>
|||ok fine it is working but how i can transfer data from local to domain
server.
Tibor Karaszi wrote:[vbcol=seagreen]
> Read the file from your code, take the SQL from the file you read and put it in a command object.
> Whenever you reach GO in the script file, execute what you have in the command object using
> ExecuteNonQuery.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "santosh" <Santoshmshinde_it@.yahoo.com> wrote in message
> news:1160023668.433979.75200@.i42g2000cwa.googlegro ups.com...
|||I'm not sure what you are asking here. What data do you refer to, where is it? Between two SQL
Servers?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"santosh" <Santoshmshinde_it@.yahoo.com> wrote in message
news:1160108798.342356.275430@.e3g2000cwe.googlegro ups.com...
> ok fine it is working but how i can transfer data from local to domain
> server.
> --
> Tibor Karaszi wrote:
>
|||i am having data at my local sql server but i need to transfer it on
domain sql server. but i don't have direct access of domain enterprise
manager or query analyzer i am having only DSN Name uid and pwd.
Tibor Karaszi wrote:[vbcol=seagreen]
> I'm not sure what you are asking here. What data do you refer to, where is it? Between two SQL
> Servers?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "santosh" <Santoshmshinde_it@.yahoo.com> wrote in message
> news:1160108798.342356.275430@.e3g2000cwe.googlegro ups.com...

No comments:

Post a Comment