Viewing 15 posts - 2,191 through 2,205 (of 5,504 total)
Please have a look at the CrossTab and DynamicCrossTab articles referenced in my signature.
The CrossTab version for your last query would look like
SELECT PA_EnterpriceID
,MAX(CASE WHEN [Top 10]=1 THEN PP_NAME ELSE...
January 6, 2011 at 12:52 am
To quote the editorial:
and then let them bend rules, change procedures where it counts
The question is: Who's going to decide whether it counts or not?
Scenario 1:
You're a DBA and a...
January 6, 2011 at 12:36 am
Another option:
Extract those 12 columns into a separate table with an identity column and replace the 12 columns in your original table with the id of the new table.
January 5, 2011 at 4:06 pm
Understood. Just wanted to make sure.
Regarding your performance concern:
As long as you're not running this code with hundred thousand of rows from your source table during peak hours, you should...
January 5, 2011 at 12:34 pm
May I recommend a minor change?
Change the data type of @vCommand in your sproc to NVARCHAR(MAX)?
The data type text is marked as deprecated starting with SS2K5.
January 5, 2011 at 9:41 am
GSquared (1/5/2011)
Are you trying to imply that a lump of plastic, metal, and toxic semiconductors can't understand that it's supposed to do what I want, not what I told it...
January 5, 2011 at 8:26 am
Here's a setup to play with including some tests to check whether a sproc will be fired or not.
USE tempdb
GO
if object_id('temp','U') is not null drop table temp
CREATE TABLE temp( idCourse...
January 5, 2011 at 7:48 am
joshtheflame (1/5/2011)
is there any other way ?
SQL side: Yes.
Please check if you can Edit:call a SQL stored proc from .NET that will return a dataset (don't know, I'm still a...
January 5, 2011 at 7:16 am
joshtheflame (1/5/2011)
January 5, 2011 at 6:14 am
joshtheflame (1/5/2011)
Lutz,Can we do the same with different technique? I mean one simple select with all the 32 desired columns?
What do you mean by "the same" and "desired columns"?
Are you...
January 5, 2011 at 5:25 am
First of all, I apologize for assuming the task being homework... 😉
Using tommy's Tally table approach, here is a set based solution:
;WITH
a1 AS (SELECT 1 AS N UNION...
January 5, 2011 at 5:22 am
joshtheflame (1/5/2011)
I got stuck in a really nasty situation with the dynamic query in my previous thread. If I run the procedure it sure populates the column and display them...
January 5, 2011 at 4:50 am
copied from another thread:
I got stuck in a really nasty situation with the dynamic query in my previous thread. If I run the procedure it sure populates the column and...
January 5, 2011 at 4:50 am
Your approach will only compare the first updated value, whereas "first" is equal "first random" in this case since there is no ORDER BY.
When you use triggers always make sure...
January 5, 2011 at 4:42 am
Did you talk to the vendor regarding your attemt? They might not provide support as soon as you start bypassing their software...
January 5, 2011 at 4:01 am
Viewing 15 posts - 2,191 through 2,205 (of 5,504 total)