Using ISNULL() or COALESCE() is even worse (worse because the QO is able to make some assumptions if the underlying field is not nullable). Dynamic SQL side-steps this because you're able to only specify the criteria needed, leaving the QO a clean path to determine the best plan....
IF update(money_column) SET@clist=@clist+'money_column,' IF len(@clist)=0 EXEC sp_sqlexec N'insert into dbo.sample_table default values' ELSE BEGIN -- cutting trailing comma SET@clist=left(@clist,len(@clist)-1) SET @tsqls='insert into dbo.sample_table ('+@clist+') select '+@...
Deserialize XML Nullable UINT Input string was not in a correct format. Deserialize XmlNode Deserialized xml containing special characters Design Error: Cannot bind to the property or column "Column Name" on the DataSource. Parameter name: dataMember design pattern question (repository pattern - serv...
Thank You GRN, Andy! I will try temporary table. The original question: How to create a solution with the following security requirements: Restrict access to historical data (datdiff>60 days) if user is member of group1, restrict acces to other data - for example several accounting info -...