Viewing 15 posts - 3,121 through 3,135 (of 6,036 total)
mtassin, you forgot to take care about NULLs.
Also, your script gonna miss the case when user decides to add a space to a string.
April 2, 2008 at 5:37 pm
Many .NET apps will write values to several fields even if the values have not changed. Am I wrong about that?
No, you're absolutely right.
Programming skills of most of developers nowadays...
April 2, 2008 at 5:34 pm
Jeff Moden (3/31/2008)
SQL ORACLE (3/31/2008)
We can use BIT MASK concept to implement this task.
Sure could... now, pretend it's 5PM on a Friday and you have a really hot gig at...
April 1, 2008 at 2:34 pm
Yes.
But you can exclude any doubts by doing this in one go:
SELECT @myERROR = @@ERROR,
@myRowCount = @@ROWCOUNT,
@OrderId = SCOPE_IDENTITY()
IF @myERROR != 0...
March 31, 2008 at 7:31 pm
Topic "SET (described)" in BOL has the answer on your question and a lot of other useful information.
March 31, 2008 at 4:18 pm
Ahmad Osama (3/31/2008)
this will be a good logic to implement on a smaal list or one shud maintain a table right from the start.
That's actually the logic you may find...
March 31, 2008 at 1:19 pm
1st you need to assign the variable value correctly.
Try this:
use northwind
declare @ProductList varchar (50)
set @ProductList = ('Chai','NuNuCa Nuß-Nougat-Creme','Geitost','Wimmers gute Semmelknödel','Original Frankfurter grüne Soße')
--unchanged so far
select @ProductList
March 30, 2008 at 9:03 pm
update tableb set ntextb=ntexta
from tablea
where nida = 55
and nidb = 222
March 30, 2008 at 4:01 pm
And if you put the list of your columns into specially designed table:
CREATE TABLE dbo.TriggerUpdatedColumns (
TriggerName sysname,
ColNo smallint
)
You can use simple script :
IF EXISTS (
SELECT 1 FROM dbo.TriggerUpdatedColumns
WHERE TriggerName =...
March 30, 2008 at 3:47 pm
Alex, int value returned by POWER function holds 4 bytes, 32 bits.
It's more than enough for your 14 columns.
There is no need for any SUBSTRING.
Your problem is the way you...
March 30, 2008 at 3:41 pm
SQL ORACLE (3/19/2008)
DECLARE @Date DATETIME
SELECT @Date = MAX(DateUpdated) FROM myTable
IF @Date > DATEADD(d,...
March 19, 2008 at 4:30 pm
rbarryyoung (3/19/2008)
Huh. Good point Gogula (great name, my compliments to your parents).
I wonder how Jeff got himself responding to somebody with a nickname like YOURS.
😀
Look at his...
March 19, 2008 at 3:30 pm
I would suggest relational database approach.
Something like this:
[Code]
SELECT *
FROM tblData D
WHERE EXISTS (select 1 from dbo.Calendar C
where C.Month = D.MonthID
AND C.[Quarter] = @Quarter
)
[/Code]
March 18, 2008 at 4:54 pm
Create a new table table_Copy
Copy all data from table to table_Copy except image.
Drop table, rename table_Copy to table.
If you've got some FK or other constraints don't forget to drop and...
March 16, 2008 at 7:11 pm
Viewing 15 posts - 3,121 through 3,135 (of 6,036 total)