Click here to Skip to main content
16,017,151 members
Home / Discussions / Database
   

Database

 
GeneralRe: SSIS Best Practice Regarding Storage Pin
Eddy Vluggen3-Jul-18 8:43
professionalEddy Vluggen3-Jul-18 8:43 
QuestionSSMS 2016 and SQL Server 2008R2 Pin
#realJSOP26-Jun-18 23:31
professional#realJSOP26-Jun-18 23:31 
AnswerRe: SSMS 2016 and SQL Server 2008R2 Pin
Eddy Vluggen26-Jun-18 23:50
professionalEddy Vluggen26-Jun-18 23:50 
AnswerRe: SSMS 2016 and SQL Server 2008R2 Pin
Victor Nijegorodov27-Jun-18 1:07
Victor Nijegorodov27-Jun-18 1:07 
AnswerRe: SSMS 2016 and SQL Server 2008R2 Pin
Richard Deeming27-Jun-18 1:35
mveRichard Deeming27-Jun-18 1:35 
GeneralRe: SSMS 2016 and SQL Server 2008R2 Pin
#realJSOP27-Jun-18 2:46
professional#realJSOP27-Jun-18 2:46 
QuestionSQL Server Agent Monitoring Pin
#realJSOP26-Jun-18 1:48
professional#realJSOP26-Jun-18 1:48 
QuestionCheck for object existence sql server 2012 is creating stored procedure as dynamic sql Pin
indian14325-Jun-18 10:36
indian14325-Jun-18 10:36 
Hi,

I wanted to create script with Check for Objects existence in SQL Server, when I have enabled that option from Options -> SQL Server Object Explorer->Check for object existence, its creating the script for the Check but Stored Procedures are created using dynamic sql as below, any help would be very very helpful thanks in advance friends.
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Usp_Add_AddressCommunication]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
/****************************************************************************************************/
/* NAME     : [Usp_Add_AddressCommunication]                                                                        /
/ PURPOSE  : THIS STORED PROCEDURE Addes address communication /
/ TABLES USED:                                                                                         /
/                  [dbo].[CommunicationTypeLKP]    , AddressCommunication  , Address                                                           /
<h2>/ VERSION HISTORY:-                                                                                    */</h2>

<h2>/* VERSION NUMBER|  DATE        |   AUTHOR                  |   CHANGES                                 */</h2>

/* 1.0           |  09/19/2017  |   aaleti              |   INITIAL VERSION                         */

<hr />

ALTER PROCEDURE [dbo].[Usp_Add_AddressCommunication] 
(

    @AddressId int,
    @CommunicationType varchar(60),
    @CommunicationValue varchar(60),
    @CreatedBy varchar(30)

)

AS
BEGIN
DECLARE @CommTypeId int
SET @CommTypeId = (Select top 1 CT.PKCommunicationTypeLKPId from CommunicationTypeLKP CT where CT.CommunicationTypeDesc = @CommunicationType)

         INSERT INTO [dbo].[AddressCommunication]
           ([FKAddressId]
           ,[FKCommunicationTypeLKPId]
           ,[CommunicationValue]
           ,[ValidFlag]
           ,[CreatedDate]
           ,[CreatedBy]
           ,[ModifiedDate]
           ,[ModifiedBy]
           )
     VALUES
           (@AddressId
           ,@CommTypeId
           ,@CommunicationValue
           ,1
           ,getdate()
           ,@CreatedBy
           ,getdate()
           ,@CreatedBy)
            select SCOPE_IDENTITY() as PkAddrCommId

END
' 
END

Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."
AnswerRe: Check for object existence sql server 2012 is creating stored procedure as dynamic sql Pin
Richard Deeming26-Jun-18 1:50
mveRichard Deeming26-Jun-18 1:50 
QuestionPDO/mySQL/PHP - when is it OK to NOT use parameter binding, when should I REALLY use it? Pin
needAbreakNow17-Jun-18 16:13
needAbreakNow17-Jun-18 16:13 
AnswerRe: PDO/mySQL/PHP - when is it OK to NOT use parameter binding, when should I REALLY use it? Pin
Jörgen Andersson17-Jun-18 19:29
professionalJörgen Andersson17-Jun-18 19:29 
AnswerRe: PDO/mySQL/PHP - when is it OK to NOT use parameter binding, when should I REALLY use it? Pin
Mycroft Holmes17-Jun-18 20:43
professionalMycroft Holmes17-Jun-18 20:43 
AnswerRe: PDO/mySQL/PHP - when is it OK to NOT use parameter binding, when should I REALLY use it? Pin
Eddy Vluggen18-Jun-18 0:27
professionalEddy Vluggen18-Jun-18 0:27 
AnswerRe: PDO/mySQL/PHP - when is it OK to NOT use parameter binding, when should I REALLY use it? Pin
jschell23-Jun-18 5:12
jschell23-Jun-18 5:12 
QuestionPDO Get Previous and Next Record partially working Pin
needAbreakNow16-Jun-18 21:19
needAbreakNow16-Jun-18 21:19 
AnswerRe: PDO Get Previous and Next Record partially working Pin
Richard MacCutchan16-Jun-18 21:32
mveRichard MacCutchan16-Jun-18 21:32 
AnswerRe: PDO Get Previous and Next Record partially working Pin
Victor Nijegorodov16-Jun-18 22:45
Victor Nijegorodov16-Jun-18 22:45 
AnswerRe: PDO Get Previous and Next Record partially working Pin
needAbreakNow16-Jun-18 23:06
needAbreakNow16-Jun-18 23:06 
GeneralRe: PDO Get Previous and Next Record partially working Pin
Richard MacCutchan17-Jun-18 1:11
mveRichard MacCutchan17-Jun-18 1:11 
GeneralArgus Pin
Keith@Stand15-Jun-18 4:17
Keith@Stand15-Jun-18 4:17 
GeneralRe: Argus Pin
CHill6015-Jun-18 4:21
mveCHill6015-Jun-18 4:21 
GeneralRe: Argus Pin
jschell23-Jun-18 5:17
jschell23-Jun-18 5:17 
QuestionCode Expert Pin
Keith@Stand7-Jun-18 8:13
Keith@Stand7-Jun-18 8:13 
AnswerRe: Code Expert Pin
OriginalGriff7-Jun-18 8:16
mveOriginalGriff7-Jun-18 8:16 
AnswerRe: Code Expert Pin
Swinkaran7-Jun-18 18:39
professionalSwinkaran7-Jun-18 18:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.