November 5, 2003 at 5:11 am
Hello!
I would like this to happen:
I create a new database. In the database, I would like to create new tables
and SP from a file.
How can I do this? Are there any easier way of doing this? Could anyone
guide me to open the file. Do I put the information inside a StringList, and
use this to create the tables? Help!
--
- Lars
-Lars
Please only reply to this newsgroup. All mails would be bounced back.
-Lars
Please only reply to this newsgroup. All mails would be bounced back.
November 5, 2003 at 5:15 am
Do you mean you have a file containing all DDL statements and you're looking for a way to execute this file?
If so, open it with Query Analyzer, point to the right db, and hit F5 to run your statements
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
November 5, 2003 at 5:19 am
Well that's not the issue here. How can I do this in code? Not in EM or QA, but in my application.
I createt the sql file in EM(Enterprise Manager) when selected script a database.
I was thinking of opening this file in my application and run the result in my application. Now I have all information inside the registry - but I don't think that's very good.
- Lars
-Lars
Please only reply to this newsgroup. All mails would be bounced back.
-Lars
Please only reply to this newsgroup. All mails would be bounced back.
November 5, 2003 at 5:23 am
What about using isql or osql utilities that come with SQL Server?
They are explained in BOL
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
November 5, 2003 at 5:45 am
Can I distribute the isql application?
-Lars
Please only reply to this newsgroup. All mails would be bounced back.
-Lars
Please only reply to this newsgroup. All mails would be bounced back.
November 5, 2003 at 5:50 am
I don't know, but I thought you're developing an SQL Server application. In this case your client needs a license of SQL Server anyway. And so he should have both utilities.
Btw, can you delete the other post on the same topic?
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
November 5, 2003 at 5:51 am
yes! what a fool!
-Lars
Please only reply to this newsgroup. All mails would be bounced back.
-Lars
Please only reply to this newsgroup. All mails would be bounced back.
November 5, 2003 at 5:54 am
quote:
Btw, can you delete the other post on the same topic?
Sorry - but how do I delete it?
-Lars
Please only reply to this newsgroup. All mails would be bounced back.
-Lars
Please only reply to this newsgroup. All mails would be bounced back.
November 5, 2003 at 5:58 am
you should see a trash can icon above the post.
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
November 5, 2003 at 7:22 am
I receive an error.
Msg 170, Level 15, State1, Server LTG_ARBST, Line 1
Line 1: Incorrect syntax near ' '.
I can run this script in QA, but not in isql.
Here is the code:
isql /s(LTG_ARBST) /E /dLars /i c:\SQLTEST.SQL /n
And here is the sqltest.sql
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tr_i_AUDIT_ARCHIVE_TABLE]') and OBJECTPROPERTY(id, N'IsTrigger') = 1)
drop trigger [dbo].[tr_i_AUDIT_ARCHIVE_TABLE]
-Lars
Please only reply to this newsgroup. All mails would be bounced back.
-Lars
Please only reply to this newsgroup. All mails would be bounced back.
November 5, 2003 at 9:14 am
Try Osql
* Noel
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply