Showing posts with label experts. Show all posts
Showing posts with label experts. Show all posts

Wednesday, March 28, 2012

rowid is there?

Hi experts,
I'm in need to use the rowid of a column.
is there any concept like rowid?

for example, i need the first row of a table.or 5th row of a table.how can i write the query?

thank you verymuch in advance.

Quote:

Originally Posted by vinod

Hi experts,
I'm in need to use the rowid of a column.
is there any concept like rowid?

for example, i need the first row of a table.or 5th row of a table.how can i write the query?

thank you verymuch in advance.


select top 1 * from tablename|||Add a column of int datatype to the existing table. Define identity on that column. Define Identity seed and identity increment as 1,1.
The following is the syntax.

a int identity(1,1). Here a is the column. SQL Server automatically increments the number. Based on that number you can fetch the desired record.|||Using Identity function is really great friend.
I'm trying for my purpose now, if i need some more assistance, i'l come back to you

Monday, March 26, 2012

'ROW_NUMBER' is not a recognized function name.

Hi experts,
recently i download the SQLExpress 2005 version to do some testing,
when i try to run a new feature which all ROW_NUMBER, but SQL give me
error
'ROW_NUMBER' is not a recognized function name.
i wondering after install the 05, we need to add-on some package to
support this kind of feature,. which is not default '
* the sample is from
http://msdn.microsoft.com/sql/learn...tsqlenhance.asp
pls give advise, many thanksJust the routine check. I hope you are not connecting to a SQL Server 2000
instance from the SQL Srvr Management Studio express edition.|||Check your database compatibility level
exec sp_dbcmptlevel '<Name of db>'
HTH
Kalen Delaney, SQL Server MVP
"XJ" <ianyian@.hotmail.com> wrote in message
news:1148698630.294392.99660@.g10g2000cwb.googlegroups.com...
> Hi experts,
> recently i download the SQLExpress 2005 version to do some testing,
> when i try to run a new feature which all ROW_NUMBER, but SQL give me
> error
> 'ROW_NUMBER' is not a recognized function name.
> i wondering after install the 05, we need to add-on some package to
> support this kind of feature,. which is not default '
> * the sample is from
> http://msdn.microsoft.com/sql/learn...tsqlenhance.asp
> pls give advise, many thanks
>|||Hi Kalen,
i catch u, which give me 80, yes i agree that i have sql 2000
before, but i already uninstall it, rght now under the service name
call XJ\SQLEXPRESS.
and i have use "Microsoft SQL Server Management Studio Express",
but even i try to create a new DB, still give me 80,. pls give some
idea how can i create a DB which have 2005 feature under "studio
express" or any other way ,. .. many thanks|||Hi Kalen , Omnibuzz
Bcos the instance make me some confuse ,. finally i can
connect ! ya ,. many thanks !!!!

Friday, March 23, 2012

Row to Column

Hi experts,

Ex. Data set in TableA

ID, Value
-----
1,A
2,B
1,F
3,C

Expected result set

ID, Value
----
1,A,F
2,B
3,C

Can I do this with T-SQL?

Thanks.

Regards
DishanCheck out

http://www.aspfaq.com/show.asp?id=2529|||Thanks mark|||Hi Mark,

Please tell me how to do the following :

ID Col#1 Col#2
1 A F
2 B
3 C

I want to post the values in seperate columns.

Regards,

Khatri