Tag Archives: SQL - Page 3

Simple Talk Blog – Top 10 SSRS Challenges and Solutions

Ryan Duclos wrote a great article on 10 Common Issues with SSRS. Download his Code, too.

FROM  http://www.simple-talk.com/sql/reporting-services/ten-common-sql-server-reporting-services-challenges-and-solutions/

Read more »

Except and Intersect operators in SQL Server 2005/2008 (from decipherinfosys)

Good Explanantion and usage examples of the Except and Intersect  Operators in SQL 2005 ( 2008).

From decipherinfosys
In SQL Server 2005, MSFT introduced two new operators in their T-SQL language: Except and Intersect. We had briefly touched upon these while discussing the MERGE command in Oracle – you can read more on that post here. EXCEPT returns the distinct data value from the left query (query on left side of the operand) which does not exist in the right query (query on the right side of the operand). INTERSECT returns data value which is common in both queries. In Oracle, the equivalent of the EXCEPT operator is MINUS and INTERSECT is same as INTERSECT. In SQL 2005, using EXCEPT and INTERSECT, one can also simulate the MERGE command in Oracle (see the blog post that is mentioned above).

Read Full Post Here

SSRS – Format() and FormateDateTime()

Found this reference … JUST IN TIME!

Thanks Thavash This is by far my most visited page.

http://thavash.spaces.live.com/blog/cns!CF6232111374DFD2!155.entry

April 10

Working with Dates in Reporting Services

As with any other technology ( eg. SQL , C# ), you always find people running into problems with processing of dates. I was asked today , “How to I format dates when using the Date Picker and sending it through to a stored procedure” ? Let’s have a look ….
1) The FormatDateTime command
This is pretty easy to use, but maybe a bit limiting. You can specify 1 of 4 formats using the command arguments. Let’s say we have selected a date such as 10th April 2007 , our results will be as follows :
Command Result
FormatDateTime(Parameters!Date.Value,1) Tuesday, April 10, 2007
FormatDateTime(Parameters!Date.Value,2) 4/10/2007
FormatDateTime(Parameters!Date.Value,3) 12:00:00 AM
FormatDateTime(Parameters!Date.Value,4) 00:00

…but the better way to do it would be to use …

2) The Format command and specify the exact format you require. For example…

Command Result
Format(Parameters!Date.Value,”dd-MM-yyyy”) 10-04-2007
Format(Parameters!Date.Value,”dd/MM/yyyy”) 10/04/2007
Format(Parameters!Date.Value,”MMM-dd-yyyy”) Apr-10-2007
Format(Parameters!Date.Value,”MMM-dd-yy”) Apr-10-07

So 3 M’s give you “Apr” ….anyway this is quite useful if you’re looking for Day/Month/Year , since the system will default to MM/DD/YYYY.

Using this you should be able to display the date format you want , or send through a particular format to a Stored Proc.

EDITED 22/08/2007 : If the Format Command doesn’t work , try converting the value to a date , eg.

Format(Cdate(Parameters!Date.Value),”dd-MM-yyyy”)

Jeff’s SQL Server Blog – Proper Case UDF

Using My Favorite Tech Service –http://www.Google.Com.

I Found this Posting for a Proper case T-Sql User Defined Function on Jeff’s SQL Server Blog — Go to the post as it has an port to MySQL and a couple of other ‘ADVANCED’ examples in the comments.

From the original Blog :

I posted this one a long time ago and needed to use it today, so I thought I’d post it up here as well in case anyone finds it useful.  This simply attempts to capitalize the first letter of each word for the string passed in.  Use it to help clean up some pre-existing data, but don’t use it as a way of presenting your data that is stored improperly since it isn’t exact.�
Read more »

T-SQL – Create View to look at Database Indexes

Wrote a simple query to look at basic attributes of indexing in a specific database:

SELECT    [IndexGroup]

               ,[FileName]

               ,[TableName]

               ,[IndexName]

               ,[dpages]

               ,[rowcnt]

               ,[rows]

               ,[OrigFillFactor]

               ,[groupid]

               ,[allocpolicy]

               ,[status]

               ,[groupname]

FROM [dbo].[INDEX_INFORMATION]

[Click Below to get the complete code used to create the database view]

Read more »

SQl Server 2005 Reporting Services – Charts

Found this link that give a deep-dive into fomat and functionality of charts in SSRS 2005.  Adds a lot to making charts meaniningful and jumps to details.

TechNet Article:
More

SSRS Links on sql-server-performance.com

Found this link on http://sql-server-performance.com  to various Reporting Services Links : HERE

Good FAQ on http://www.ssw.com.au  on issues and set-up of SSRS – HERE

SQL Server Memory Sizing

Saw a link to this in a http://www.sqlservercentral.com/ Newsletter.

SearchSQLServer.techtarget.com – Memory Sizing

Worth checking out for server sizing and links to KB articles on using AWE memory, etc.

Linked Server Example from Original Site

Older article/post on Linked Server functionality in SQL Server 200-2005 and 2K8.

https://jackdonnell.com/articles/linked_Serv.htm

I mostly  use the OpenQuery() select statments to get to MySQL and other platforms. Watch your security Model!