Problem with nolock statement  
Author Message
lgratkowski





PostPosted: Visual Studio Team System - Database Professionals, Problem with nolock statement Top

Hi,

I've found that if I have nolock used in an UDF or SP in database Data Dude gives me a warning message ans so I cannot build my project successfully. For instance, I have an UDF like the one below :

CREATE FUNCTION [dbo].[SearchAuthorByArticleID] (

int

)

RETURNS TABLE

AS

RETURN

(

SELECT AuthorID

from [dbo].[Authors] (nolock) as auth

WHERE

)

Compiling this gives me warning msg : "Warning 1 TSD2010: Incorrect syntax near as." But when I comment that nolock statement it's completely OK then. When I try to import that UDF from DB, DataDude writes changes to ScriptsIgnoredOnImport.sql

Is that a bug Can I use nolock statements while working with DD

Luke



Visual Studio Team System24  
 
 
Richard Waymire - MSFT





PostPosted: Visual Studio Team System - Database Professionals, Problem with nolock statement Top

The lock hint and the table alias are not working together. It's bug #609192 that I just filed for you. So for now you can either remove the lock hint or the table alias.

 
 
lgratkowski





PostPosted: Visual Studio Team System - Database Professionals, Problem with nolock statement Top

Thanks!!