Feb 22, 2008

Getting all columns for a Table

Using INFORMATION_SCHEMA View

 

Getting all columns for a Table

SELECT * FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = '<TABLE NAME>'

 

Getting all constraints for a Table

SELECT * FROM  INFORMATION_SCHEMA.TABLE_CONSTRAINTS where TABLE_NAME = '<TABLE NAME>'

 

Getting all check constraints for a Table

 

SELECT * FROM INFORMATION_SCHEMA.CHECK_CONSTRAINTS where CONSTRAINT_NAME IN (SELECT CONSTRAINT_NAME FROM  INFORMATION_SCHEMA.TABLE_CONSTRAINTS where TABLE_NAME = '<TABLE NAME>')

 

 

For more about INFORMATION_SCHEMA please visit (However this link is a kb for a bug still has enough pointers to go ahead)

http://support.microsoft.com/kb/294350

 

Happy learning

Feb 20, 2008

SilverLight 1.1 MediaElement Example

Here are the links for SilverLight 1.1 MediaElement example.

Nice links to get hands on SilverLight 1.1

 

http://blogs.msdn.com/coding4fun/archive/2008/01/22/7163484.aspx

http://www.codeproject.com/KB/silverlight/SLFun.aspx

 

Do it and Have fun!

 

 

Mediaelement not showing the media.

SilverLight 1.1 Media element not showing the media.

Mediaelement not working with my case, but may be these links will help in your case.

http://silverlight.net/forums/p/1532/8690.aspx#8690

http://silverlight.net/forums/t/2914.aspx

I am using like

<MediaElement Width="400" Height="300" Canvas.Left="10" Canvas.Top ="10" Source="viz.wmv" AutoPlay="True"/>

It don’t showing any error but not showing the video also.

When I tried using http://sever/viz.wmv its giving download error ErrorType: 1001

Trying to get what may be the reason.

After a lot of hard work I get the problem.

The video file I was using having some problem, however this was working with media file. Funny na ?? So let check with other media file also, if you are facing the same problem.

mediaelement not showing the media.

SilverLight 1.1 Media element not showing the media.

 

Mediaelement not working with my case, but may be this link will help in your case.

http://silverlight.net/forums/p/1532/8690.aspx#8690

 

I am using like

<MediaElement Width="400" Height="300" Canvas.Left="10" Canvas.Top ="10" Source="viz.wmv" AutoPlay="True"/>

It don’t showing any error but not showing the video also.

When I tried using http://sever/viz.wmv its giving download error ErrorType: 1001

 

Trying to get what may be the reason.

 

Feb 15, 2008

Getting all the constraints for a Table

How to get all the constraints for a table?

 

Sysconstraints table –

This is the table which contains the constraints which are defined on various tables.

If you query by – SELECT * FROM sysconstraints

You will get OUTPUT –

constid     id          colid  spare1 status      actions     error

----------- ----------- ------ ------ ----------- ----------- ------

2099048     2133582639  6      0      2069        4096        0

11147085    1269579561  2      0      2067        4096        0

14623095    2130106629  6      0      2069        4096        0

27147142    1301579675  2      0      2067        4096        0

For details go to http://msdn2.microsoft.com/en-us/library/aa260399(sql.80).aspx

 

Now come to the actual point – getting all constraints for a table

 

SELECT OBJECT_NAME(constid) 'Constraint Name',

  constid 'Constraint ID',

  CASE (status & 0xF)

    WHEN 0x1 THEN 'Primary Key'

    WHEN 0x2 THEN 'Unique'

    WHEN 0x3 THEN 'Foreign Key'

    WHEN 0x4 THEN 'Check'

    WHEN 0x5 THEN 'Default'

    ELSE 'Undefined'

  END 'Constraint Type',

  CASE (status & 0x30)

    WHEN 0x10 THEN 'Column Level'

    WHEN 0x20 THEN 'Table Level'

    ELSE 'Unknown'

  END 'Constraint Level'

  FROM sysconstraints

  WHERE id=OBJECT_ID(‘TABLE_NAME’)

 

This will result to all the constraints applied to this table.

Feb 12, 2008

Error code 1001 silverlight

While I run a silver light application, I get the

Silverlight error message

Error Code: 1001

Error Type: DownloadError

Message: AG_E_UNKNOWN_ERROR

 

Solution: Visit the following link

http://silverlight.net/forums/t/586.aspx

 

 

 

Dec 19, 2007

How to close secure connection

I have two web service suppose A and B which should be call from an application, for this I am using Proxy class and meking the call. To get access these services one need to have client certificate. Now the problem is that when I calling the services one by one A and B one in one go , A is working but B is failing. But if i call both in one go [ofcourse one by one] both A and B work.

What may be the problem??

I think it is due to once connection is opened by A used by the B so both passes while in case of individual A and B fail. If we change the order of calling now the B fails , A passes.

SQL - Difference between CAST,CONVERT and PARSE

TODO---