Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to use prod and dev in Sql Procedure

Author  Topic 

reacha
Starting Member

49 Posts

Posted - 2010-12-06 : 10:13:48
In one of my SQL procedure i need to use both prod and dev servers because of inconsistency in tables

i dont know the syntax to write.

below is the script that i am using but getting an error

IF @PROCESSID = 6
BEGIN
IF Server Name = 'ROCFDN001QFP03\FDNPRD03'
BEGIN
SELECT @ScannedDate = COL8 FROM [WFLOW].[WFUSER].[WF_FIELDVALUE_6]
WHERE [WFLOW].[WFUSER].[WF_FIELDVALUE_6].PKGID = @pkgid
END

ELSE IF Server Name = 'RONFDN802Q\FDNDEV03'
BEGIN
SELECT @ScannedDate = COL6 FROM [WFLOW_Dev].[WFUSER].[WF_FIELDVALUE_6]
WHERE [WFLOW_Dev].[WFUSER].[WF_FIELDVALUE_6].PKGID = @pkgid
END

END

Please help me out!!

Thanks,
reacha

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-12-06 : 10:32:10
Can you post the error message?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2010-12-06 : 10:40:11
Maybe
IF @@servername = 'ROCFDN001QFP03\FDNPRD03'


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -