Viewing 15 posts - 3,106 through 3,120 (of 4,081 total)
I don't believe I've ever used a GOTO in T-SQL, if I ever knew they existed. But today I learned that they "are not uncommon" in T-SQL. ...
April 11, 2009 at 8:34 am
The original example was actually following the IF/Begin-End ELSE/Begin-End structure.
By the way, Alvin, enjoyed the presentation Thursday night.
April 11, 2009 at 8:24 am
Okay... how many people here advocate the use of GOTO statements in T-SQL?
April 11, 2009 at 8:08 am
GOTO is not uncommon in TSQL
Really? It's been so long since I've seen one, that I'd forgotten that it ever existed.
I'm with Flo. ...
April 11, 2009 at 8:06 am
You might try running the code before making pronouncements like that. 😉
I'm looking at the following results on my screen right now.
Status State ...
April 11, 2009 at 7:18 am
Will this work?
declare @sample table (Status varchar(10), State varchar(20), Name Varchar(10))
insert into @sample
select 'Pending', 'Nebraska', 'ABC' union all
select 'Pending', NULL, 'XYZ' union all
select 'Active', NULL, 'PQR'
select *
from @sample
where state...
April 10, 2009 at 2:51 pm
You're using the left function in a join, which might prevent proper use of indexes. You might also want to consider an approach like this. Warning:...
April 10, 2009 at 2:37 pm
Sure. Have a look at this and let me know if you have any questions.
declare @sample table (SessionID int, question varchar(30), response varchar(30))
insert into @sample
select 1, 'Name', 'Mike'...
April 10, 2009 at 2:18 pm
I just re-read your question. Since you have the metadata that defines names, datatypes, and lengths for your output columns, you could parse those attributes to build a...
April 10, 2009 at 7:59 am
Read about OPENXML on books online. You can query an XML document and simply write the results to a table, then look at the schema. ...
April 10, 2009 at 7:51 am
If you would please write a short script to define temporary tables and put a few rows into them, then people can test their solutions to your problem before posting...
April 10, 2009 at 7:12 am
have you heard of Schrödinger's cat???
Heard of it? I'm in the box with it!!
April 10, 2009 at 7:03 am
I just revised the final select clause in the previous post to match your output example exactly.
It looks like a lot of code, but it runs in a millisecond 😉
April 9, 2009 at 2:59 pm
How about this then? I would have had it for you sooner, but your order threw me. Your example shows the combinations in an unusual sequence. ...
April 9, 2009 at 2:44 pm
In the code below, the "Combos" cte is used to develop concatenated strings of the TXNCDs for each BON. After that, a simple count of the combinations produces...
April 9, 2009 at 2:20 pm
Viewing 15 posts - 3,106 through 3,120 (of 4,081 total)