![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I was just wondering why this command: select * from C_Update where lastname like '%,%' works fine in query analyzer, but when used within the confines of an execute sql task in this fashion: DECLARE @CommaCheck nvarchar(4000) SET @CommaCheck = 'select * from C_Update where lastname like '%,%'' EXEC @CommaCheck It generates an error. The error pertains to the %,% area, but I can't figure out another way to rearrange the code w/o using the apostrophe. Make sense? Also, I was digging through the net and found a very good page on dynamic sql in which it was mentioned that one should never use "select" in production code... Which is exactly what I'm doing. Rather confusing as a newbie dtsprogrammer. Any help is thankfully appreciated! |
![]() |
| Thread Tools | |
| Display Modes | |
| |