Skip to content
Advertisement

SQL Server 2005: Determine datatype of variable

Is it possible to determine the type of a local variable at runtime in TSQL? For example, say I wanted to do something along these lines: Or Does anyone know of any way to accomplish this? EDIT: This is not for a specific task, this is more of a general knowledge question. I do appreciate answers that indicate that the

Is a view faster than a simple query?

Is a faster than the query itself to create the view (in order to have the same resultSet): ? It’s not totally clear to me if the view uses some sort of caching making it faster compared to a simple query. Answer Yes, views can have a clustered index assigned and, when they do, they’ll store temporary results that can

SPARQL Query, select everything except things that match?

I am getting comfortable writing regular queries in SPARQL, but I’m still having trouble with fancier stuff. My latest problem is trying to select everything except stuff that matches the where clause. For instance, say I want to find all the husbands who like a car color that their wife doesn’t like (I’m working on a proprietary model, so excuse

Cleanest way to build an SQL string in Java

I want to build an SQL string to do database manipulation (updates, deletes, inserts, selects, that sort of thing) – instead of the awful string concat method using millions of “+”‘s and quotes which …

Advertisement