Friday, May 28, 2010

How to generate WSDL files

So you created a new web service in .NET and want to start integration with the application that is going to use your web service.

Wait, there is a problem. The other application is written in JAVA and they ask you to get them the WSDL file so they can build a reference.

Here is how you get the *.wsdl file:
1) run CMD
2) go to C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin
********* can be other VS version
3) run: disco.exe [WS URL]

and there you have it.

Wednesday, May 26, 2010

How to launch the MS download manager

Have you ever stated downloading from Microsoft's website using the MS download manager and it closed in the middle for some reason?

Here is what you can do to get it started again (open the UI):

1) Open a command window

2) Change Directory to %SystemRoot%\Downloaded Program Files\

3) Type TransferMgr.exe and press Enter

That's it. Simple.

Tuesday, May 25, 2010

New website - SQL Basic Training

I recently uploaded a new website for SQL Basics training: www.SQLBasics.com

I tried to cover the basics just enough to get someone started.
I'll appreciate any comments, questions or requests you might have.

Monday, May 24, 2010

SQL tempdb and constraint names

A weird thing I found out about MS-SQL's tempdb a few days ago was that the server does not hash the constraint names.

I don't know if you know the way tempdb is working in MS-SQL but the basic concept is that when a process is creating a temp table the tempdb is hashing the name to create a unique instance for the running session.

so if you write a code that looks like this:
create table #TestTabe (id int, descript nvarchar(50))

in runtime you will see in the tempdb something that looks like this:
#TestTable________________123213E2B

the main reason is that you can have multiple sessions running at the same time.

Let's add a constraint to the equation:

CREATE TABLE #TestTable(
id int, descript nvarchar(50),
CONSTRAINT [PK_#TestTable] PRIMARY KEY CLUSTERED
(
[id] ASC
)
)


in runtime you will see something like this:




The normal way tempdb is operating is when the session ends (i.e. stored procedure finished it's execution) or when the user manually drop the table it's deleted from the tempdb with all of it's constraints.
if your session fails for some reason and you didn't catch it the tempdb is not cleaned and the table (with the hashed name) and it's constraints are left in the tempdb.
This is not a big deal in general cause the table name is hashed for each session so the next session will have no problem creating it's own instance of the table.
The weird stuff I found out and kind'a puzzled me was that MSSQL does not hash the constraint name! so the next session that tried to create the table FAILD with the error of "Constraint already exists in the db"!
So until the next cleanup of the tempdb (restart of the sql server should do the job) the process is stuck and will fail every time!
The solution?
Wrap your code with try & catch so you can drop all the temp tables in the case of a failure! The code I saw (not my code of course :-) )was not wrapped and this created an issue.
That's it for today.
Till the next time, keep coding...
Joseph Gozlan

Who am I?

I guess what you are thinking to yourself is "who is this guy?" and "why should I bother reading his Blog?"

Well, I can answer the first question easily, my name is Joseph Gozlan and I'm an Information Systems Engineer from Plano, TX, USA.

I work for Retalix USA (RTLX). I've been with Retalix for the past 6 years doing all kind of jobs and filling a few positions. I've started as a .NET developer, been a .NET Team Leader and a technical expert.

I was Born and raised in Israel and relocated to Plano Texas in 2007.

Why should you read my Blog?
I don't have a really good answer for that there are many great Bloggers out there with great writing skills. I can only say what kind of info I plan on posting here and you will be the judge if you think this can interest you or not. Every once in a while I find out small technical things that I find interesting or helpful (see next entry about SQL's tempdb). So this is the kind of stuff I'll share here. it can be from the .NET development world, SQL server tricks or even some motivation related items (I follow Daniel Pink's great Blog)

That's it. If you have any questions, shoot.

First Blog entry

So I figured it's about time I joined the Bloggers community.
for a while now I've been emailing people with interesting technological stuff and I figured It'll be easier to maintain a Blog than to send emails. Plus, let's face it, Blog helps with the SEO to my website: www.JosephGozlan.com