Viewing 15 posts - 631 through 645 (of 1,156 total)
You my friend have a collation problem. The problem is you are using accent sensitive collation. If you check your collation, it is probably SQL_Latin1_General_CP1_CI_AS. The problem...
February 15, 2008 at 9:16 pm
This segment of code looks right. I would work my way through the code testing it piece by piece, from the top to the bottom. This way you...
February 15, 2008 at 5:25 pm
Sorry, before making my post I really did not look at your data. The problem is that you are wanting to compare the inserted data to a table that...
February 15, 2008 at 2:42 am
Your left join is messing you up. Using left joins with additional join filters is not the most reliable method to return data. You should use the where clause...
February 14, 2008 at 10:07 pm
All the syntax looked good except that in the CASE statement @PayFormulaCode you are missing the end. I think this is the one you were speaking of before. ...
February 14, 2008 at 9:51 pm
+ ' = ' + @HolderNum + ')
HolderNum is an integer so when you are trying to concatenate it to the string, SQL server is trying to add the value...
February 14, 2008 at 9:18 pm
Good solution ksullivan. I like it. It is much better than making the entire code block dynamic sql and is quite efficient.
February 14, 2008 at 5:48 pm
Between the code we have discussed and the above mentioned โprintโ, there are two more IF statements (working) and a CASE select statement (working) of around 25 lines. Plus some...
February 14, 2008 at 5:44 pm
You cant do it like that. You have to use truly dynamic sql.
e.g.
DECLARE @sql nvarchar(500)
SET @sql = N'
IF NOT EXISTS(SELECT ' + @ColumnName + ' FROM ' + @TableName...
February 14, 2008 at 5:09 pm
Your begin and ends look to be correct. One thing I see with the code is your are comparing comparing units to null, with an equal operator
OR @Units =...
February 14, 2008 at 5:04 pm
I would use ISNUMERIC
select distinct acct
from tbl_CYProcessedSales
where ISNUMERIC(Acct) > 0
order by acct
February 14, 2008 at 3:21 pm
If exists should have a begin and end too. It is much easier to see this when you format the code, to make it look purtee ๐
IF @PayFormulaCode =...
February 14, 2008 at 3:02 pm
Ok, I misunderstood what you are doing. I thought you were updating user ids. When an update occurs the new value goes into inserted and the old value...
February 14, 2008 at 1:19 pm
In the output clause you have access to the inserted and deleted tables. To get the original value you would have to use the deleted table.
e.g.
DECLARE @tTest1 TABLE
(...
February 14, 2008 at 11:45 am
You run into more problems with dynamic sql like indexing, caching, recompiles etc. But if you must go with a dynamic sql solution I would recommend that you use...
February 14, 2008 at 11:16 am
Viewing 15 posts - 631 through 645 (of 1,156 total)