Viewing 15 posts - 61 through 75 (of 171 total)
Thanks Eugene a nice sugestion!:w00t:
But I want to know if there any way to trick SP_ExecSQL to pass a object name as a varible do a dynamic SQL as a...
March 7, 2012 at 5:30 am
Yes Jeff,
I dislike to make dynamic SQL like that.
(SQL Inject prone AND no statistics AND recompilations...)
Is it possible to use the @tableName and @columnName in a safe way with sp_executeSQL?
Anyway.
If...
March 7, 2012 at 4:49 am
I'm not a DBA but I was introduced to the SQL world because while working in a tiny company someone (anyone) must take care of the DB.
So I learned T-SQL,...
March 6, 2012 at 11:41 am
Create a pattern, if your team mates can read it and understand it easy its a good pattern.
Returning two homonimal columns in a query is a nuisance, I agree but...
March 6, 2012 at 9:23 am
Cadavre (3/6/2012)
Cool.Try this non-cursor one instead and see if you get any joy 😀
Pretty good! :w00t:
non-cursor was my initial goal but I give up just because its not possible to...
March 6, 2012 at 8:53 am
Eugene Elutin (3/6/2012)
...Your generic one is cool! Pack it, wrap it and sell it 😀
I'll no sell it, I just like to code and make it for funny. You can...
March 6, 2012 at 8:39 am
Eugene Elutin (3/6/2012)
I have a gut feeling that this requirement comes from not very well thought out design.
Me too...
I cannot see why would you want to do what OP...
March 6, 2012 at 8:01 am
Well, I wrote a more generic solution to any user table.
create table TESTE (PK int, C1 char(1), C2 char(1), C3 char(1), C4 char(1), C5 char(1))
GO
insert into TESTE values
(1, 'a', NULL,...
March 6, 2012 at 7:40 am
The only scenario where letting the query in the report is better than writing a SP is when the DB lies in a third party server and you have no...
March 6, 2012 at 4:30 am
Are you trying some sort of
select ISNULL(c1,'')+ISNULL(c2,'')+...
?
March 6, 2012 at 4:18 am
Prefix is good to diff between views and tables.
Adding the table name to the columns is a bit redundant.
Except for the FKs (or if you like single char aliases in...
March 6, 2012 at 4:10 am
If you are afraid of creating a table named CAVEAT and in any point in the future it begins to be a T-SQL reserved word you can prefix your objects...
March 5, 2012 at 1:35 pm
I'm pretty sure SQL ill not multiply chars '1' * '4' it demands at least one numeric type to decide for the result type.
Yes! Implicit convertion is evil.
Even worst when...
February 29, 2012 at 4:17 am
bmovedout IS NULL
is a better option than:
ISNULL(bmovedout, 0) <> -1
if there are a index for the [bmovedout] column.
Since the second option forces the query to evaluate the ISNULL() function for...
February 28, 2012 at 6:18 am
A view can do the trick but for big tables I can choose to add a column to tblWV to flag the source table.
February 28, 2012 at 5:01 am
Viewing 15 posts - 61 through 75 (of 171 total)