T-SQL HELP.

  • On one of my DB Servers which is using SQL Server 2005, public server role is missing, can anybody let me know what might be the root cause of it?

    Also i have one stored procedure, before the stored procedure starts it has the following piece of code:

    USE [Database Name]

    GO

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    Create procedure proce_name

    as

    begin

    T-SQL

    end

    When i again click on the stored procedure name and select modify, the block of code above create procedure statement disappears.

    Please could someone help me on this?

  • singhsatnam84 (8/12/2010)


    Also i have one stored procedure, before the stored procedure starts it has the following piece of code:

    USE [Database Name]

    GO

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    Create procedure proce_name

    as

    begin

    T-SQL

    end

    When i again click on the stored procedure name and select modify, the block of code above create procedure statement disappears.

    The code for your stored procedure doesn't start until the word "CREATE". Everything above that is setup code. You are specifying your database, then setting some standard settings to keep things consistant. These are NOT part of your procedure so won't show up when you modify it.

    I wouldn't worry a whole lot about the public role. I've never heard anyone recommend using it.

    Kenneth

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • If you want SSMS to generate the extra stuff, go to the Tools menu, select Options, go to SQL Server Object Explorer and then Scripting underneath that. You can set exactly what you do and don't want it to script for you.

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply