Viewing 15 posts - 5,611 through 5,625 (of 7,636 total)
You want the DENSE_RANK() function:
Select Id, DENSE_RANK() OVER(order by Id) as [Seq_Num]
From MyTable
September 3, 2008 at 11:55 am
And how can you tell which one was the first inserted? SQL Server does not necessarily either store them or return them in the same order that you inserted...
September 3, 2008 at 11:51 am
OK, this will get the entire length:
select o.name, m.definition
from master.sys.system_sql_modules m
join master.sys.system_objects o
ON o.object_id = m.object_id
Of course, getting the entire definition out of...
September 3, 2008 at 11:47 am
"Select [text] from master.sys.syscomments" works but is limited to 4000 characters.
September 3, 2008 at 11:41 am
In what context are you trying to do this? A SELECT? A View? An INSERT Trigger? A stored procedure that is writing to the table?
It is...
September 3, 2008 at 11:29 am
psangeetha (9/3/2008)
But the trick is, I need to populate the value of first cno in the CIT.desc.
Define "first". Remember that relational database have no inherent order of their...
September 3, 2008 at 11:23 am
Glad I could help.
September 3, 2008 at 11:15 am
GibsonM111 (9/3/2008)
If I'm logged into SQL Server Management Studio using Windows Authentication, shouldn't SQL Server use my account?
Not necessarily. The actual security context that SQL Server uses for external...
September 3, 2008 at 11:08 am
#Temp tables are unique per-session, not per procedure.
#Temp tables can span subordinate Batches, but is dropped when the batch that created it exits. EXEC('..') and sp_ExecutSQL() create subordinate batches...
September 3, 2008 at 10:43 am
I don't know what account OPENROWSET from SQL Server runs under, but you should make sure that it has the necessary access to that directory and file.
September 3, 2008 at 10:20 am
Mind you, I do not know if these numbers are correct. I am just saying that they are reasonably possible. 😀
September 3, 2008 at 10:14 am
blandry (9/3/2008)
September 3, 2008 at 10:11 am
ALTER is not an option for the Script Generator. The Script Generator is the thing in SSMS that can script multiple objects at a time.
The facility that creates the...
September 3, 2008 at 9:59 am
At this point, the only two things that I am fairly certain would work are:
1. A SQLCLR proc that recieves an XML parameter and writes it to...
September 3, 2008 at 9:29 am
Viewing 15 posts - 5,611 through 5,625 (of 7,636 total)