Viewing 15 posts - 91 through 105 (of 113 total)
Dave is right, This sort of code is useful for delivering updated code or something, but if you're writing an application that depends on this, I guarantee there's a better...
February 3, 2010 at 5:00 pm
Sure, you just have to wrap it in a block like this:
IF EXISTS(SELECT NULL FROM sys.columns WHERE [name] = 'x' AND OBJECT_NAME([object_id]) = 'b')
UPDATE b
...
February 3, 2010 at 4:52 pm
I'm sorry it looks like I reversed the order of those.
The select statement looks at the table definition for a column named X in the table named A
So if that...
February 3, 2010 at 4:35 pm
I just found the answer:
http://msdn.microsoft.com/en-us/library/ms190476%28SQL.90%29.aspx
I may submit this as a QOTD...
February 3, 2010 at 2:14 pm
It's possible the others have mnade your problem more complicated than you intended.
If you were just looking for how to tell if a column exists in a table, you can...
February 3, 2010 at 12:03 pm
So I reread what I wrote, and there's actually two issues. The most important one actually has nothing to do with using tables or table variables (you handle this correctly).
Depending...
January 20, 2010 at 12:52 pm
A couple of notes on Florian's post:
The sample script works because you're using Table variables, which are local to the scope. If you use real tables, it is not...
January 20, 2010 at 10:06 am
That's a pretty well thought-out Reply Tom. Got any pointers on how to avoid these risks? (Other than not taking the job in the first place 🙂 So,...
November 4, 2009 at 11:17 am
Similar to the ansi nulls setting suggestion, you should check the concatenation settings if you are joining (or if your subquery is correlated) based on data types other than int.
October 20, 2009 at 2:34 pm
The biggest problem I have with getting "Professional" outside help is my past bad experiences with consultants who came across as very knowlegable, but in the end couldn't deliver. ...
October 15, 2009 at 5:10 pm
No Problem.
One other thing I noticed: You've hard-coded which size, width and color you want to use, yet you then proceed to look up the ids for those values....
October 15, 2009 at 4:09 pm
It's also possible to copy and paste directly into the table in management studio if the layout of your spreadsheet matches the table.
If you're looking for a programmatic method, look...
October 15, 2009 at 3:25 pm
I'll take a stab at your question regarding the subquery, although I have to admit that I'm not as experienced or as talented as Gail and Grant.
I believe that you...
October 15, 2009 at 3:19 pm
GSquared (10/1/2009)
I have to mention that seeing the title of this article made me wonder if SSC had changed into a different type of website overnight. 😉
Heh, so did I....
October 1, 2009 at 10:35 am
Perhaps what you're looking to avoid is creating 6 new tables to store the relationships between your four tables( a to b, a to c, b to c...). It...
August 24, 2009 at 10:21 am
Viewing 15 posts - 91 through 105 (of 113 total)