Viewing 15 posts - 331 through 345 (of 367 total)
Do a short trace (5 seconds will probably be enough) with sql profiler, with event "SP:Starting" and "SP:StmtStarting".
You will probably find function or computed column that is called zillion times.
March 7, 2011 at 2:19 am
I'll show you simple example.
First, prepare test data:
SELECT name = 'age', value = 20
into #fact
union all
SELECT 'age', 30
union all
SELECT 'age', 40
union all
SELECT 'height', 180
union all
SELECT 'height', 190
select * from #fact
WITH...
February 26, 2011 at 1:21 pm
You cannot have two objects with the same name in a namespace.
In Orace, schema equals to user, and schema is a namespace. You cannot have two objects of the same...
February 26, 2011 at 12:52 pm
Or simply press XDetails button (free plugin) on that table name in sql editor,
and you'll see all info you need.
February 26, 2011 at 8:06 am
I write a lot of t-sql and use XDetails (www.sqlxdetails.com) to look-up tables and columns.
February 21, 2011 at 12:29 am
Maybe this could work for you:
build a batch of sql commands and store them into varchar(max).
Call it with parameters using sp_executesql.
Example with two sql command in one batch:
EXEC sys.sp_executesql N'select...
February 17, 2011 at 2:41 am
Documenting the database is very important.
You can see descriptions next to the table columns quite easily with XDetails plugin (free): www.sqlxdetails.com
February 17, 2011 at 1:48 am
You can also see column descriptions next to each column with this very useful addin: www.sqlxdetails.com
February 12, 2011 at 7:53 pm
No, you cannot do that. You could maybe build your query with UNION ALL of the queries and get the result you wanted.
Are you sure you cannot avoid dynamic queries...
February 12, 2011 at 7:47 pm
You're welcome! 😉
jfm3
what exactly is "ws" used with the STUFF function?
"ws" is alias I choosed for #WeekSchedules table, ommiting optional "AS" keyword (I could write "from #WeekSchedules AS ws" or...
February 7, 2011 at 3:51 pm
jfm3 (2/7/2011)
February 7, 2011 at 7:52 am
All that you want in one short answer:
Prepare the data (you should have posted that!):
select MondayRequired='x', TuesdayRequired='x', WednesdayRequired = 'x', ThursdayRequired='x', FridayRequired='x'
into #WeekSchedules
union all select 'x', '', null, '', 'x'
union...
February 5, 2011 at 3:13 pm
Hi.
Solution provided so far will not work.
You can use a neat trick with CASE nested in the SUM() aggregate function.
With that trick, solution is really simple, and even without joins:
Prepare...
February 5, 2011 at 2:38 pm
First, download the documentation. It is called "books online". Search with google books online for your version of sql server. This is example for SQL 2008R2 (put that in google):
sql...
January 31, 2011 at 1:27 pm
Viewing 15 posts - 331 through 345 (of 367 total)