Showing posts with label int. Show all posts
Showing posts with label int. Show all posts

Thursday, March 22, 2012

((0)) set as Default Value or Binding for an int Data Type

Hi there,

I'm trying to set an int type attribute to 0 for its Default Value, but it keeps reverting to ((0)). What is causing this?

Every int type attribute on that table does the same. There is one bit type attribute and a bunch of other type of attributes, but non of them are giving me a problem. The table is a copy from another database and I did check all the constraints and properties to make sure they're the same.

Thank you,

--Alex

That is normal behavior for SSMS.

Monday, March 19, 2012

"Synonyms"

Hi all,

Just as a curiosity (and thoroughness) thing, why are there synonyms in SQL Server? When I say synonyms, i mean INT and INTEGER, OUT and OUTPUT: These word pairs mean the same thing!

And in some examples they chop and change between the use of these words... It adds to the confusion.

Anyhows I'm curious as to the "why" behind this.

Thanks

Chris

Interesting Topic...

Here I want to tell 2 things,

1. SQL-92 Standard

2.T-SQL Standard

SQL Server 2000 is mangaed to support SQL-92 & its own native specification (T-SQL) for backward Compatibility.

INT, INTEGER

Both are came from SQL-92 specification. as per the SQL-92 specification INT = Ada Type Specification for INTEGER

OUT, OUTPUT

OUT is introduced in SQL-99 specification & freezed/accepted in SQL-2003 specification.

Now a days almost all the database trying to supprt the ANSI SQL standard. But none of them created their database only with ANSI Standard. They declared their database as SQL-XX standard and adopting the latest standard or inventing new concepts to beat their competitors.For example SQL Server 2000 is ANSI-SQL-92 compliant but it supports lot of features which is freezed on SQL-99/2003 standard(like Boolean datatype(with null), User Defined data type & etc.).

There are lot more topics there to disucss..

|||

Hi ManiD,

Thanks for that. For some reason knowing the why just makes it easier to accept some things :)

Cheers

Chris

Sunday, February 19, 2012

<SelectParameters> & checked items from CheckBoxList

Column1 in table 1 has a range from 1 to 5 (int)

A CheckboxList displays these 5 items. When checked (for example 1 and 4) I want a gridview with sqldatasource=sqlProducts to display the records where column1 values 1 or 4.

When I use the code below I only get the records where column1 values 1...

<asp:SQLDataSource id="sqlProducts" Runat="Server" SelectCommand="Select * From Table1 where Column1 IN (@.CBLchecked_items)" ConnectionString="<%$ ConnectionStrings:pubs %>">
<SelectParameters>
<asp:ControlParameter Name="CBLchecked_items" ControlID="CBL" propertyname="SelectedValue" type="String" />
</SelectParameters>
</asp:SQLDataSource>

Hi~

SelectedValue returns the first selected value .

You can iterate to get all selected values:

For i = 0To Check1.Items.Count - 1If Check1.Items(i).SelectedThen' List the selected items s = s & Check1.Items(i).Text s = s &","End If Next
Hope it helps.|||

I got the problem to get the checked item in CheckBoxList here is the code :

foreach (ListItem itemin cblRoles.Items){if (item.Selected)// here the item.Selected always = false {// do something } }
 

Thursday, February 9, 2012

# prefix on table

Hi, I have created a table with the following

docmd.runSQL "Create Table #Test(A int)"

in Access 2000 and cannot find the table on my table list, it's not on my enterprise manager either. My guess is that maybe it has something to do with the prefix #? So I started searching for "Create table #" on google and dbforums and cannot find anything. Can someone tell me what's special about having a #prefix on a table and where can I find more information about it?

Thanks

SHKLook up "temporary table" in Books OnLine (BOL). And to throw a little oil on the fire, # is a temp table local to the spid, adn ## is a global temporary table.|||Thanks a bunch