Viewing 15 posts - 391 through 405 (of 427 total)
Oh and by the way: if your concern is just to delete all referencing rows when the end user deletes a referenced row, then you may want to have a...
September 21, 2010 at 4:08 am
AFIK, there is no standard functionality for that. You'll have to write that yourself. What I did (for my employer, so I can't disclose the full code) was to generate...
September 21, 2010 at 4:02 am
I have yet another alternative. Not only would I split the numeric and the alphanumeric part of the unknown numbers into separate columns, I would suggest also splitting the unknown...
September 15, 2010 at 12:09 am
Have you maybe tried to insert the 2nd record and failed to do so because a non-nullable column was left unspecified or an fk-condition was not met? If the insert...
September 8, 2010 at 6:38 am
John Mitchell-245523 (9/7/2010)
September 8, 2010 at 6:12 am
An after insert trigger is exactly what you need. You've probably just forgotten to use the table Inserted to identify which rows were affected by the insert statement.
i.e. you need...
September 8, 2010 at 2:42 am
Well spotted, WayneS.
Apart from that error in the string manipulation, it's better (for performance and to avoid internationalization issues) not to use string manipulation at all on your datetime values....
September 8, 2010 at 12:09 am
All you need to do is add a where clause. And you'll have the functionality without a cursor. Something like where name in ('testdb','myotherdb')
September 7, 2010 at 1:17 pm
I would suggest using the quotename() function. Here's an example. Plus, as a bonus, this runs the query against all databases in your server.
declare @create_date datetime
declare @cmd nvarchar(max);
set @create_date...
September 7, 2010 at 3:19 am
I have been thinking for a solution for similar issues (we've got an auditing in place that uses suser_sid() which raises the same issues for updates, inserts and deletes performed...
August 18, 2010 at 3:41 pm
Guys, this topic was about the article on the usage of grouping() but you've moved away to wether or not to add a sort clause now. I feel a little...
July 19, 2010 at 3:31 pm
When you want to identify the "scheme totals"-rows in your result set you need to add another GROUPING() column, this time specifying the Scheme_Name column for its parameter.
SELECT
ISNULL(Product_Name,'ZProductTotal') as...
July 13, 2010 at 1:03 am
I did the test and combined Mike's test data with (most of) the suggestions:
*** Peso ***********************************************************************
SQL Server Execution Times:
CPU time = 0 ms, elapsed time =...
June 30, 2010 at 4:39 am
Hi Brian, why would you want to eliminate row_number() from the query? Simply copy and paste your code into the test script that SwePeso posted and see for yourself how...
June 29, 2010 at 2:03 pm
Another variation on the previous suggestions. See what happens to all the other solutions when any of the roles is changed into for example 'R&D'. Plus, I don't like the...
June 29, 2010 at 7:13 am
Viewing 15 posts - 391 through 405 (of 427 total)