Showing posts with label somebody. Show all posts
Showing posts with label somebody. Show all posts

Wednesday, March 7, 2012

Creating a DB script

Somebody knows a tool able to generate DB scripts from a .mdf file?

Management Studio Express.

Right-click on the database and choose 'Script Database As..." and select an option. You can also script individual objects. This does not include data, you'd need to use BCP for data.

Management Studio Express CTP is at http://www.microsoft.com/downloads/details.aspx?familyid=57856cdd-da9b-4ad0-9a8a-f193ae8410ad&displaylang=en.

Regards,

Mike Wachal
SQL Express team

-
Check out my tips for getting your answer faster and how to ask a good question: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=307712&SiteID=1

|||I already tried Managment Studio Express, but for some reason it cannot access my .mdf file that is located at:
C:\Documents and Settings\Neto\Mis documentos\Visual Studio 2005\Projects\ProjectName\Database\myBD.mdf

The tree view that browses the folders won't let me get past 'My Documents'|||

SQL Express runs as the Network Services account, which is a limited access account that doesn't have permissions for a number of things, including User Profile directories.

If this is a one time operation, I would suggest detaching the database and moving it to a location where you can access it (such as the MSSQL\Data directory), attaching it there and then using Management Studio to generate the scripts.

If this is a task you need to do repeatedly, you'll probably need a programatic way to do this. I haven't been able to find a T-SQL method for doing this, maybe someone else knows of one. If not, you can do this from SMO, which you can get an overview of starting at http://msdn2.microsoft.com/en-us/library/ms162557.aspx.

Regards,

Mike Wachal
SQL Express team

-
Check out my tips for getting your answer faster and how to ask a good question: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=307712&SiteID=1

Sunday, February 19, 2012

Creating a .NET Stored Procedure in Sql Server 2005 Express Edition

Could somebody tell me how do we create a .NET Stored Procedure in Sql Server 2005 Express Edition and deploy and debug it against the database from Visual Studio 2005 or Visual Web Developer? Can some one also let me know which approach is faster among .NET stored procedure or T-SQL stored procedure?

Regards...

Shashi Kumar Nagulakonda.

I can't help you with the first question.

The answer to the second question is obviously it depends. As far as I know (and I know very little about .NET sps), given the same task, the T-SQL sp should execute faster. Now that doesn't preclude that yes, you can write a really bad T-SQL sp that performs worse than a well written .NET sp, but as far as I know the .NET sp's work on sets of data very similiarly to a cursor, and therefore will experience the same speed (or lack thereof). Not to mention the overhead of loading the .NET runtime into memory, and doing all the jitting. Then again, some things would be much easier in .NET because T-SQL isn't a full programming language, so the .NET sps have a much greater versitality.

Again, I have actually no experience with using, writing, or debugging .NET sp's. If someone more knowledgable wants to chime in, please do so.