Showing posts with label value. Show all posts
Showing posts with label value. Show all posts

Friday, March 30, 2012

INFORMATION_SCHEMA and increment

I try to identify the value of increment property of a column.
INFORMATION_SCHEMA does not suppply it.
Somebody know how to get it ?
Thanks
The ANSI standard INFORMATION_SCHEMA views don't expose proprietary
extensions like IDENTITY values. However, you can augment the results using
functions like IDENT_CURRENT. For example:
USE Northwind
SELECT IDENT_CURRENT(
QUOTENAME(TABLE_SCHEMA) +
'.' +
QUOTENAME(TABLE_NAME)
) AS CurrentIdentity
FROM INFORMATION_SCHEMA.TABLES
WHERE
TABLE_SCHEMA = 'dbo' AND
TABLE_NAME = 'Orders'
Hope this helps.
Dan Guzman
SQL Server MVP
"DigitalGus" <papierCrayon@.hotmail.com> wrote in message
news:KFjkc.25427$k%.581253@.news20.bellglobal.com.. .
> I try to identify the value of increment property of a column.
> INFORMATION_SCHEMA does not suppply it.
> Somebody know how to get it ?
> Thanks
>
|||http://www.aspfaq.com/2177
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"DigitalGus" <papierCrayon@.hotmail.com> wrote in message
news:KFjkc.25427$k%.581253@.news20.bellglobal.com.. .
>I try to identify the value of increment property of a column.
> INFORMATION_SCHEMA does not suppply it.
> Somebody know how to get it ?
> Thanks
>
sql

INFORMATION_SCHEMA and increment

I try to identify the value of increment property of a column.
INFORMATION_SCHEMA does not suppply it.
Somebody know how to get it ?
ThanksThe ANSI standard INFORMATION_SCHEMA views don't expose proprietary
extensions like IDENTITY values. However, you can augment the results using
functions like IDENT_CURRENT. For example:
USE Northwind
SELECT IDENT_CURRENT(
QUOTENAME(TABLE_SCHEMA) +
'.' +
QUOTENAME(TABLE_NAME)
) AS CurrentIdentity
FROM INFORMATION_SCHEMA.TABLES
WHERE
TABLE_SCHEMA = 'dbo' AND
TABLE_NAME = 'Orders'
Hope this helps.
Dan Guzman
SQL Server MVP
"DigitalGus" <papierCrayon@.hotmail.com> wrote in message
news:KFjkc.25427$k%.581253@.news20.bellglobal.com...
> I try to identify the value of increment property of a column.
> INFORMATION_SCHEMA does not suppply it.
> Somebody know how to get it ?
> Thanks
>|||http://www.aspfaq.com/2177
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"DigitalGus" <papierCrayon@.hotmail.com> wrote in message
news:KFjkc.25427$k%.581253@.news20.bellglobal.com...
>I try to identify the value of increment property of a column.
> INFORMATION_SCHEMA does not suppply it.
> Somebody know how to get it ?
> Thanks
>

INFORMATION_SCHEMA and increment

I try to identify the value of increment property of a column.
INFORMATION_SCHEMA does not suppply it.
Somebody know how to get it ?
ThanksThe ANSI standard INFORMATION_SCHEMA views don't expose proprietary
extensions like IDENTITY values. However, you can augment the results using
functions like IDENT_CURRENT. For example:
USE Northwind
SELECT IDENT_CURRENT(
QUOTENAME(TABLE_SCHEMA) +
'.' +
QUOTENAME(TABLE_NAME)
) AS CurrentIdentity
FROM INFORMATION_SCHEMA.TABLES
WHERE
TABLE_SCHEMA = 'dbo' AND
TABLE_NAME = 'Orders'
--
Hope this helps.
Dan Guzman
SQL Server MVP
"DigitalGus" <papierCrayon@.hotmail.com> wrote in message
news:KFjkc.25427$k%.581253@.news20.bellglobal.com...
> I try to identify the value of increment property of a column.
> INFORMATION_SCHEMA does not suppply it.
> Somebody know how to get it ?
> Thanks
>|||http://www.aspfaq.com/2177
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"DigitalGus" <papierCrayon@.hotmail.com> wrote in message
news:KFjkc.25427$k%.581253@.news20.bellglobal.com...
>I try to identify the value of increment property of a column.
> INFORMATION_SCHEMA does not suppply it.
> Somebody know how to get it ?
> Thanks
>

Monday, March 26, 2012

Infinity

First row show "Infinity" with this calc.
=((Fields!Total_Rooms.Value - Previous(Fields!Total_Rooms.Value))) /
Previous(Fields!Total_Rooms.Value)
How to not show "Infinity" on first row? TIA
--
William Stacey [MVP]Use the following expressing
"=IIF(IsNothing(Previous(Fields!Total_Rooms.Value)),
0,
(Fields!Total_Rooms.Value - Previous(Fields!Total_Rooms.Value)) /
Previous(Fields!Total_Rooms.Value))"
In the mentioned expression, u can replace "0" with the value u want to
display.|||Thanks saras.
--
William Stacey [MVP]

Friday, March 23, 2012

inesert null value

Hi All,

I am using c# (asp.net 2.0) and sql 2005.

I need to check whether the checkbox is checked then insert the current date or insert a empty/null values.

I used this condition chkTFR.Checked ?DateTime.Now :SqlDateTime.Null.Value or chkTFR.Checked ?DateTime.Now :System.DBNull.Value

In the database table I create a field with datetime type. I am not able to insert a null value to the field. If anybody had an experience pls post your code.

I am using strongly typed dataset & tableadapter to insert the values to the database table. (for your reference C this link:http://www.asp.net/learn/data-access/tutorial-01-cs.aspx)

ThanX in advance

Brotherly

~FAAS

The article in the following link covers your issue:

http://www.c-sharpcorner.com/UploadFile/sd_patel/EnterNullValuesForDateTime11222005015742AM/EnterNullValuesForDateTime.aspx

|||

Hi,

I used

SqlDateTime.Null.Value

I got this error message when I press the submit button.

Data is Null. This method or property cannot be called on Null values.

Remember I am using the strongly Typed DataSet & TableAdapter method.

Regards

~FAAS

|||

Hi faas1,

I guess you are using tableadpter database direct methods to insert data (like, tableadapter.Insert(your insert value)).

You can try to use "null" instread ofSqlDateTime.Null.Value /DBNull.value in your Insert() method. I've tested in my side and it works fine.

Hope my suggestion helps

Indicating the NULL value in Report Expression Syntax

Hi,

I would like to know how I can indicate a NULL value in a report expression in SSRS / Report Designer.

I am trying to code :

IIF(Value_A = 0, <NULL>, Value_A)

It may look weird but I am trying to return NULL values when Value_A is 0 (zero), in the sample scenario above.

I have tried using the keyword "NULL", but it is highlighted as a syntax error, and suggested to use System.DBNull. I tried it and then it says that components of the System collection cannot be used in an expression, so I am left drawing blanks.

Thanks.

regards,
Kenny

Use the VB keyword "Nothing"

=Iif(Fields!Value_A.Value = 0, Nothing, Fields!Value_A.Value)

|||Hi Adam,

Thanks for the tip. Worked like a charm.

Where else can I get a list of VB keywords I can use in Report Designer / SSRS / SQL Server 2005. I have some background with VB6 prior and was hoping I could port a whole bunch of them over to be used here.

Kenny
|||Most global functions were ported to VB.NET and that's what's supported in RS. For more details about RS expressions and the functions start from here http://msdn2.microsoft.com/en-us/library/ms159238.aspx

Wednesday, March 21, 2012

Indicating the NULL value in Report Expression Syntax

Hi,

I would like to know how I can indicate a NULL value in a report expression in SSRS / Report Designer.

I am trying to code :

IIF(Value_A = 0, <NULL>, Value_A)

It may look weird but I am trying to return NULL values when Value_A is 0 (zero), in the sample scenario above.

I have tried using the keyword "NULL", but it is highlighted as a syntax error, and suggested to use System.DBNull. I tried it and then it says that components of the System collection cannot be used in an expression, so I am left drawing blanks.

Thanks.

regards,
Kenny

Use the VB keyword "Nothing"

=Iif(Fields!Value_A.Value = 0, Nothing, Fields!Value_A.Value)

|||Hi Adam,

Thanks for the tip. Worked like a charm.

Where else can I get a list of VB keywords I can use in Report Designer / SSRS / SQL Server 2005. I have some background with VB6 prior and was hoping I could port a whole bunch of them over to be used here.

Kenny
|||Most global functions were ported to VB.NET and that's what's supported in RS. For more details about RS expressions and the functions start from here http://msdn2.microsoft.com/en-us/library/ms159238.aspx