Viewing 15 posts - 121 through 135 (of 206 total)
select * from tblemp where empid=isnull(@empid,empid)
You can change your select to something like above. Does that work?
August 17, 2009 at 10:02 am
So if you are doing nested transactions like this you don't need to have the inner "begin transaction" just a "save transaction" statement? I tested this and it works...
August 14, 2009 at 1:13 pm
Wow, thank you. I have yet to use nested transactions like this and thought I was going crazy.
August 14, 2009 at 1:09 pm
Very cool. I have ran this a couple time but sometimes the execution result in an infinite loop. I didn't have time today to figure out where a...
August 14, 2009 at 9:08 am
Yes, I have seen wargames. 🙂 I was just curious to find a set of moves where the very last move was a win.
So lets say we change...
August 13, 2009 at 2:47 pm
If you are stuck with not using bcp then you probably need to change the datatype of the @cmd variable to varchar(max) also. sysname is basically a nvarchar(128) datatype.
August 13, 2009 at 7:30 am
I guess I am unclear on what your expected result set is.
August 13, 2009 at 6:22 am
Have you made sure this productID exists? The adventureWorks database I have installed does not have this productID.
August 13, 2009 at 6:08 am
I can't think of a way to do this without knowing something static after the username. Here is what I did and I guess it will work for the...
August 13, 2009 at 6:06 am
Lets see if this is closer. The code has a couple comments but I will try to expand. The dateadd function takes 3 parameters (datepart, number, start date)....
August 12, 2009 at 12:01 pm
I really don't think you will have to use a cursor for this. I am still not sure about the statements below. What condition has to be satisfied?...
August 12, 2009 at 9:32 am
I think you are asking for something like this. I have created test tables and test data so if this is inaccurate let me know. This will change...
August 12, 2009 at 8:33 am
I don't think this does what you want but it does what you asked for and it will be able to get you started at least.
CREATE TABLE #temp (Mon INT,...
August 10, 2009 at 2:55 pm
Using the same logic as the 2 different approaches above you will get 2 different result sets:
[Code]
SELECT * FROM #REF
WHERE (Code1 in ('SS18','SS19') OR Code2 in ('SS18','SS19') OR Code3 in...
August 10, 2009 at 2:42 pm
Not the first time this has come up.... Some interesting ideas can be found here:
http://www.sqlservercentral.com/Forums/Topic719090-150-1.aspx
August 10, 2009 at 2:15 pm
Viewing 15 posts - 121 through 135 (of 206 total)