Showing posts with label scripts. Show all posts
Showing posts with label scripts. Show all posts

Wednesday, March 28, 2012

MSSQL

I have created a tool using vb.net,with mssql as backend.i need to
create the database and the table in the database using some scripts or
what ever relevent methods.How can we make the database while
installing the software.you could call the following from VB.NET:
osql.exe -Usa -Ppassword -i d:\dbr\create_database_script.sql -n
-oD:\DBR\OUTPUT\SQL_SCRIPT_LOGS\outputfile.txt
--
--
Sasan Saidi
Senior DBA
MSc in CS, MCSE4, IBM Certified MQ 5.3 Administrator
"I saw it work in a cartoon once so I am pretty sure I can do it."
"Armagadone" wrote:
> I have created a tool using vb.net,with mssql as backend.i need to
> create the database and the table in the database using some scripts or
> what ever relevent methods.How can we make the database while
> installing the software.
>

MSSQL

I have created a tool using vb.net,with mssql as backend.i need to
create the database and the table in the database using some scripts or
what ever relevent methods.How can we make the database while
installing the software.
you could call the following from VB.NET:
osql.exe -Usa -Ppassword -i d:\dbr\create_database_script.sql -n
-oD:\DBR\OUTPUT\SQL_SCRIPT_LOGS\outputfile.txt
--
Sasan Saidi
Senior DBA
MSc in CS, MCSE4, IBM Certified MQ 5.3 Administrator
"I saw it work in a cartoon once so I am pretty sure I can do it."
"Armagadone" wrote:

> I have created a tool using vb.net,with mssql as backend.i need to
> create the database and the table in the database using some scripts or
> what ever relevent methods.How can we make the database while
> installing the software.
>

MSSQL

I have created a tool using vb.net,with mssql as backend.i need to
create the database and the table in the database using some scripts or
what ever relevent methods.How can we make the database while
installing the software.you could call the following from VB.NET:
osql.exe -Usa -Ppassword -i d:\dbr\create_database_script.sql -n
- oD:\DBR\OUTPUT\SQL_SCRIPT_LOGS\outputfil
e.txt
--
Sasan Saidi
Senior DBA
MSc in CS, MCSE4, IBM Certified MQ 5.3 Administrator
"I saw it work in a cartoon once so I am pretty sure I can do it."
"Armagadone" wrote:

> I have created a tool using vb.net,with mssql as backend.i need to
> create the database and the table in the database using some scripts or
> what ever relevent methods.How can we make the database while
> installing the software.
>

MSSMS 05 generates all stored procedures as dynamic sql

Hi,
For some odd reason my MSSMS05 has started generating all stored
procedure scripts as dynamic sql. I cannot seem to find any options
under options-->scripting that seem related to this.
To clarify, when right-clicking a stored procedure and selecting
'modify' or any of the options under 'Script stored procedure as', the
output is wrapped as a dynamic sql statement, wrapped in exec
sp_executesql statements.
What option have I foolishly turned on, and where can I turn it off
again?
best regards,
Henrik
Try the "Include IF NOT EXISTS clause" option under Tools | Options /
Scripting. Since this requires an IF block, and you can't have a GO inside
of this, you need to use dynamic SQL.
"Henrik" <nielsen.henrik@.gmail.com> wrote in message
news:185b136f-b493-4047-bb95-e96b44713c2c@.j44g2000hsj.googlegroups.com...
> Hi,
> For some odd reason my MSSMS05 has started generating all stored
> procedure scripts as dynamic sql. I cannot seem to find any options
> under options-->scripting that seem related to this.
> To clarify, when right-clicking a stored procedure and selecting
> 'modify' or any of the options under 'Script stored procedure as', the
> output is wrapped as a dynamic sql statement, wrapped in exec
> sp_executesql statements.
> What option have I foolishly turned on, and where can I turn it off
> again?
> best regards,
> Henrik
|||That did it, thank you very much Aaron!
On Dec 4, 1:18 pm, "Aaron Bertrand [SQL Server MVP]"
<ten...@.dnartreb.noraa> wrote:[vbcol=seagreen]
> Try the "Include IF NOT EXISTS clause" option under Tools | Options /
> Scripting. Since this requires an IF block, and you can't have a GO inside
> of this, you need to use dynamic SQL.
> "Henrik" <nielsen.hen...@.gmail.com> wrote in message
> news:185b136f-b493-4047-bb95-e96b44713c2c@.j44g2000hsj.googlegroups.com...
>
>
sql