|
can some one tell me how to create a sequence in sql server 2000. pls help me asap....
tilak
|
|
|
|
|
tilak.gummadi wrote: can some one tell me how to create a sequence in sql server 2000
In SQL Server IDENTITY property is the equivalent of the oracle's sequences. IDENTITY property can be set to the columns of the types tinyint, smallint, int, bigint, numeric, decimal. It is used in the form of IDENTITY(seed, increment)
Example,
CREATE TABLE abc(
f1 int IDENTITY(10,2),
f2 varhar(100)
)
Also have a look at this[^] for more details.
Regards
________________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
Thanks a lot uroojkhan....this thing realy helped me a lot...
tilak
|
|
|
|
|
i want to link foxpro file with mssql
for that somebody suggest me to use linked servers
but i dont know how to use linked server so pls
help me about how to use linked server
Gurudatta B. Shelke
|
|
|
|
|
|
Hi - I just have a general SQL server question I'm hoping someone can help answer.
I have a table with a column of datatype TEXT called NOTE. I am trying to trim those records in the text field to say, 10000 characters where datalength(NOTE) > 10000.
for example, normally i would do something like 'update notetable set note = LEFT(note, 10000) where length(note) > 10000', but of course i can't do this with this datatype.
This datatype is a pain..Does anyone know the syntax for this?
Thanks!
Marcus Spitzmiller
You will never hear me say, "I listen to pretty much everything." That is for people who don't care what goes in their ears.
|
|
|
|
|
|
No - it'll still ultimately reside in the same column - I just need to trim it.
any thoughts?
Marcus Spitzmiller
You will never hear me say, "I listen to pretty much everything." That is for people who don't care what goes in their ears.
|
|
|
|
|
I don't see why what PIEBALDconsult suggested will not work:
select cast(mytextcolumn as varchar(1000)) as MyTextColumnTrimmed from mytesttable
Try it out.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I guess I misunderstood the suggestion.
However, I did:
select cast(NOTE as varchar(16349)) as NOTE
from S_NOTE_ACCNT
WHERE datalength(NOTE) > 16349
and I get:
The size (16349) given to the type 'varchar' exceeds the maximum allowed for any data type (8000).
So really, I need to trim the field to 16349, but apparently I can't this way...any thoughts?
Marcus Spitzmiller
You will never hear me say, "I listen to pretty much everything." That is for people who don't care what goes in their ears.
|
|
|
|
|
I don't have the data to test with but, I do believe that SUBSTRING works with the TEXT & NTEXT data types.
UPDATE
noteTable
SET
note = SUBSTRING(note,0,10000)
WHERE
DATALENGTH(note) > 10000
|
|
|
|
|
Thanks, that works. - Apparently I didn't look hard enough. I guess I didn't realize that substring existed. I tried substr and when that didn't work, I guess I thought that that function didn't exist.
Thanks again!
Marcus Spitzmiller
You will never hear me say, "I listen to pretty much everything." That is for people who don't care what goes in their ears.
|
|
|
|
|
Hello All,
I am looking to get some guidance and feed back from the community as to the prevalence and usage of the following technologies:
ODBC Descriptor support
OLE DB support
External Linked Server support
Data Link support for Data Transformation Services
Specifically I am hoping to find out when each technology should be used and the types of applications that use them. Additionally, I am wondering if there are alternatives to these technologies and why they may have been used instead.
Any guidance/feed back is appreciated.
Thanks,
---Jay
|
|
|
|
|
I have a stored procedure that can select data from several tables/views. One two of the parameters are DateTime fields. The SQL code is as follows :-
EXEC(N'SELECT * FROM ' + @objectName + ' WHERE DepotId = ' + @DepotId + ' AND [TIME] >= ' + @StartTime + ' AND [TIME] <= ' + @FinishTime + ' AND Intake = ' + @Intake + ';')
I am getting a error regarding the time parameters. I need to know how to format these for the where clause to work.
I have tried enclosing in double-quotes e.g. [TIME] <= "' + @StartTime + '" AND ...
I have also tried enclosiing hashes e.g. [TIME] <= #' + @StartTime + '# AND ...
neither works, please help
Steve Jowett
|
|
|
|
|
I've sorted it. I should have done it like this...
[TIME] <= ''' + @StartTime + ''' AND ...
Steve Jowett
|
|
|
|
|
Hi - As the subject lines suggests - can we do this in SQL 2005?
suppose I have a function_A - does certain calculations.
CREATE another_function_B<br />
(@driver int)<br />
RETURNS int<br />
AS<br />
BEGIN<br />
declare @output as int<br />
-- checks some certain type of conditions and then executes function_A<br />
select @output = dbo.function_A(@driver)<br />
return @output<br />
END
|
|
|
|
|
I don't see why not. Why didn't you just try it and see?
|
|
|
|
|
I did - it didn't get any results, which it should have. that is why decided to post a message.
I tried to debug the 'function' by using print statements but looks like that doesn't work. How could we write some debug statement?
|
|
|
|
|
Verify each item outside the UDF. That way you will see if it actually returns data.
|
|
|
|
|
hi i have one table like table.dbf & i want to link this table to mssql
pls help me for that
Gurudatta B. Shelke
|
|
|
|
|
i have databse designed in sql server 2000
i want to access that database in LAN
plz help me in this matter
abhijit
|
|
|
|
|
abhijitw wrote: i have databse designed in sql server 2000
i want to access that database in LAN
In the Server element in the connection string just specify the name of the machine that the SQL Server is installed.
|
|
|
|
|
yes sir i did the same.But, i got the following mesege:
SQL server does not exit or access denied
plz help me
abhijit
|
|
|
|
|
abhijitw wrote: ut, i got the following mesege:
SQL server does not exit or access denied
(1) Make sure the server name is correct in the connection string, or
(2) Check that the server is running, or
(3) Check any firewall issues
Hope this helps you out
Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon
|
|
|
|
|
check your sqlserver security . you must be trusted user for sqlserver.
|
|
|
|