all groups > visual studio .net ide > january 2007 >
You're in the

visual studio .net ide

group:

generate create scripts missing


generate create scripts missing TS
1/5/2007 5:48:00 PM
visual studio .net ide:
i am running vs 2005 professional and i don't have this option to do this
from server explorer like I did in '03. is that not supported in this
version or what?
t
thanks

Re: generate create scripts missing TS
1/8/2007 8:27:59 AM
that works for a table, but the stored proc doesn't do what i was expecting.
It is missing the part at the top that drops it if it exists:

if exists (select * from dbo.sysobjects where id =
object_id(N'[PR_RPT_RELATED_SVCS_OVERVIEW]') and OBJECTPROPERTY(id,
N'IsProcedure') = 1)
drop procedure [PR_RPT_RELATED_SVCS_OVERVIEW]

Having this allows you to update the proc and then just run it again without
having to worry about dropping it as an extra step.

Speaking of this, there aren't the same menu options in the context sensitve
popup that allows you to run script thru VS 2005 (run, run selection). in
2003, i have my script files in my DB project and i checkout a file, change
it, then run script all thru VS 2003 and then i check it back in. I don't
see this ability in VS 2005 :( How do i accomplish this thru VS 2005? What
good is a DB project in VS 2005 if i can't do this?

thanks

[quoted text, click to view]

RE: generate create scripts missing v-wywang NO[at]SPAM online.microsoft.com
1/8/2007 10:02:03 AM
Hi TS,

According to your description, I understand that you want to know whether
or not there is an option "Generate Create Scripts" in Visual Studio 2005.
If I misunderstand anything here, please don't hesitate to correct me.

We are indeed sorry to say this is Break Change in VS 2005.
Visual Studio 2005 can't provide this feature but we still can get this
feature through SQL Management Studio 2005.
We suggest you can use SQL Server Management Studio to generate scripts as
the following step.
Right click your Table and select "Script Table as".

We also would like to suggest you can submit this feedback to our product
feedback center if you really want our product team add this feature in
next version of Visual Studio.
http://connect.microsoft.com/site/sitehome.aspx?SiteID=210
Any suggestion from our customer will be appreciated.

Thanks for your understanding!
Wen Yuan
===============================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
===============================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Re: generate create scripts missing v-wywang NO[at]SPAM online.microsoft.com
1/9/2007 8:31:53 AM
Hi TS,

Thanks for your description. I now totally understand your scenario.
We can still get this feature named "Generate Create Script to Project" in
Visual Studio 2005 if we are developing a Database project.

Please follow the steps as below and let me know whether or not this is
what you need.

1. Create a Database Project.
2. Right click your StoredProcedures or tables in Sever Explorer.
3. Select "Generate Create Script to Project" option in context menu.
4. There will be a SQL script added in Create Scripts folder in Solution
Explorer.
5. Then you can change this file, run script all thru Visual Studio 2005.

Please test the above and let me know whether it works for you. If there is
any question, please feel free to reply here and I am glad to work with you.

Have a great day!
Wen Yuan
Re: generate create scripts missing TS
1/9/2007 1:26:09 PM
your instructions is what i do in vs 03, but that option is not in the list:

i am running '05 professional and these are the only options i get when i
right click a stored procedure:

Add new stored procedure
Open
Execute
Step into stored procedure
copy
delete
refresh
properties


[quoted text, click to view]

Re: generate create scripts missing v-wywang NO[at]SPAM online.microsoft.com
1/10/2007 11:54:17 AM
Hi TS,
Thanks for your reply.

My test machine run on Visual Studio 2005 (Professional Edition) and SQL
2005 (Enterprise Edition).
Base on my test, this option only appear when you are developing a Database
Project.
If you have created a SQL Database Project, there will not be a "Generate
create scripts to Project" option in the context menu.

Could you tell me the version of your SQL database and what project you
have created?
I will perform more research on this issue for you.
Looking forward to hearing from you soon

Have a great day!
Best regards,
Wen Yuan
Re: generate create scripts missing TS
1/11/2007 11:36:22 AM
vs 2005 professional
Sql 2005 Standard version 9.00.1399.06

ok, i guess my project is a sql db project because i created a db project
and i got that option.

What is the diff between the project template types and what would i be
missing out on if i stuck with a simple db project.

Also, why doesn't the sql db prj type have that option?

thanks

[quoted text, click to view]

Re: generate create scripts missing TS
1/11/2007 11:53:23 AM
also, why does it use sp_executesql? that makes it so its not color coded
anymore and hard to edit like that. I have to say that is pretty
dissapointing.

[quoted text, click to view]

Re: generate create scripts missing v-wywang NO[at]SPAM online.microsoft.com
1/12/2007 1:03:12 PM
Hi TS,
Thanks for your reply.

Base on my experience, the "Generate create scripts to Project" option will
only appear when we have create a Database Project (not SQL Server Project).

The SQL Server Project is used for connecting SQL database. We can create
managed code by SQL Server Project. The Database Project is used for
connecting any type database (not only the SQL database), but it is not
smart enough to create managed code. In general, if we need not to create
managed code on SQL database, we would like to suggest you can create
Database Project.

This is by design in VS 2005.
We apology for the inconvenience this have caused.

By the way, I'm sorry I cannot understand your question very well.
"also, why does it use sp_executesql? that makes it so its not color coded
anymore and hard to edit"
Would you mind clarifying it for me?

Thanks for your understanding!
Best regards,
Wen Yuan
Microsoft Online Community Support
Re: generate create scripts missing TS
1/20/2007 6:17:51 PM
sorry...when a create script is created in vs 2005 database project, the
script it creates uses sp_executesSql stored proc to create the procedure.
in VS 2003 it didn't do this in the create script generated by "generate
create scripts"

i hate using sp_executeSql because you don't get the color code as you would
with normal tsql.

thanks


[quoted text, click to view]

Re: generate create scripts missing v-wywang NO[at]SPAM online.microsoft.com
1/22/2007 8:44:25 AM
Hi TS,

Thanks for your description, I understand it now.
I think this is because "sp_executesql" is more efficient than EXECUTE.
VS 2005 uses this procedure to get more performance.
You can reference the following document to get detailed information about
sp_executesql.
http://msdn2.microsoft.com/en-us/library/ms175170.aspx
On the other side of the coin, we can not get the color code as normal tsql.

Thanks again for you reply.
If there is anything I can help with, please feel free to reply me and I'm
glad to work with you.
Wen Yuan
AddThis Social Bookmark Button