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.
| Author |
Topic |
|
1sabine8
Posting Yak Master
130 Posts |
Posted - 2008-09-29 : 05:31:11
|
| Hi,I'm writing a stored procedure. In a part of the code, i'm declaring a variable that will contain the SQL statement.Here it is:DECLARE @SQL varchar(8000) SET @SQL = "INSERT INTO #AllLoyalCustomers(ContactId)SELECT distinct dbo.FilteredContact.contactidFROM dbo.FilteredContact INNER JOIN dbo.FilteredNew_dineintakeawaycommentcard ON dbo.FilteredContact.contactid = dbo.FilteredNew_dineintakeawaycommentcard.new_contactidWHERE dbo.FilteredNew_dineintakeawaycommentcard.new_restaurantname IN '"& @RestaurantName1 &"'"i'm getting the followin error:Msg 103, Level 15, State 4, Procedure AllLoyalCustomers, Line 49The identifier that starts with 'INSERT INTO #AllLoyalCustomers(ContactId)SELECT distinct dbo.FilteredContact.contactidFROM dbo.FilteredContact INNER JOIN db' is too long. Maximum length is 128.How can i solve it?It's urgent! |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-29 : 05:32:16
|
| have provided solution here. dont cross post plaesehttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=111339 |
 |
|
|
|
|
|