Automatically Increase ID Column(please Urgent)
Dec 17, 2005i am trying to increase ID column automatically. i want ID column on my database to increase when i add new entry
thanks
i am trying to increase ID column automatically. i want ID column on my database to increase when i add new entry
thanks
Do we have any option to increase/decrease textbox width dynamically? I know that we have option to increase or decrease height.
View 6 Replies View RelatedI had several databases under sqlserver ce 2.0 (in my Pocket PC) which contained ntext fields. The size of the databases varies from 50,000 to 700,000 records. The size of an ntext field is from 4 bytes to 2 megabytes.
When I recreated my databases under sql server 2005 mobile on my desktop using VS2005 (see my post just under this one), I saw a big difference between the old and new database sizes. This problem was mentioned in one of the posts in this forum and the reply was to replace ntext data with ncharvar type.
Since most of my data was longer than 4000 bytes (which is the limit for nvarchar type), I couldn't use this suggestion. Instead, I changed my ntext type to image type and used a GetByte conversion.
No change! The size of the new database is still 50 % larger than the original. Since the difference is around 300 MB, this is an unacceptable thing.
Now, I either wait from somebody to suggest a new solution (apart from keeping the ntext data in a separate binary file and keep index of the records of this file in the records of sql database) or, most preferably, have
Microsoft solve this problem as soon as possible.
Thanks for any help in advance
Talat
Dear friends,
i've a column with nvarchar type. how can i increase the size of the column?
Vinod
hey
i've a db running sql server express sp2. the db size now is 1.1 gb
i've a table with a varchar column of size 20 . when i try to increase the column size to 50 i get a
timeout exception, and the the cloumn size is unchanged. this table has 2.5 million records
i use sql server management studio express to do the changes
is there a way to increase this timeout or whtever i can do to update this column size?
thx in advance
I need some help. I'm running Win2000 w/SQL 2000 Active/Active cluster. I've started having problems where one node will fail over automatically every night. The times are different each night and the only thing that shows up in the log file is the SQL Server terminated due to stop request from the service control manager. I can't find any error to point me in any direction. Does anyone have any idea what could be causing this?
Thanks,
Jeff
Where we have increase the size of the calculated column in cube..whether in attribute or some where else...
View 4 Replies View RelatedHi, all,
I have a question about adding a unique key column to an existing table.
what i trying to do is that: I have already created a table, now i wanna add a ID column to this table, and generate the values for ID column from 1 to the existing row number. How can I get this done?
Thanks a lot in advance for any guidance.
I am having problem with the unpivot function of sql 2012, i unpivot my column then i get the result that i wanted but the error that i was encountering was the unpivot is automatically sort the column in alphabetically order which is not I desire,
Here is my code
@syear nvarchar(50)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
[Code] ....
A common partitioning scenario is when the partition column has the same value for every record in the partition, as opposed to a range of values. Am I the only person who wonders why there isn't an option to automatically partition a table based on the unique values of the partition column? Instead of defining a partition function with constants, you ought to be able to just give it the column and be done. This would be particularly valuable for tables partitioned on a weekly or monthly date; when new data is added it could simply create a new partition if one doesn't already exist.
View 4 Replies View RelatedHello Everybody
We have a SQL Server 6.5 with SP 5a . I want to add an additional column in one of the tables of a database .
Since i don't have much experience on SQL 6.5 , i need your precious help in resolving this case .
Can somebody help me in this regard in a detail step wise manner ? Enterprise manager does not have facility to add new columns to an existing table in SQL 6.5 .
I want to add a Column called 'DM ' with datatype as 'bit' with size as 1 and as non nullable .
Any kind of help will be very precious to me .
Thank you all in advance.
Regards
Rita.
Hi all,
I'm writing a procedure and have a temporary table. One of the column in the temporary table must have an autonumber. How should I define this column when creating the temporary table!
Thank you
suppose i have a table penalties with
ticket_number, ticket_start_date datetime, ticket_end_date datetime
There are many records of same ticket_number.example:
ticket_number ticket_start_date ticket_end_date
75 2/1/03 3/2/03
75 2/4/03 5/4/03
34 2/1/03 3/3/04
34 3/4/04 3/3/05
I want to write a query which will:
1. select the ticket_number which is not active as of today
in case of ticket_number 75 it is closed so I want to print it in report
in case of 34 it was closed but now opened, so i don't want in my report.
Could anybody suggest a query how to do it?
I was trying with stored procedure and cursor :
-------------------------------------
CREATE PROCEDURE simpleTest
AS
declare @Today datetime
set @Today = '10/04/2004'
declare @colA varchar(38)
declare @colB datetime
declare @colC datetime
declare @myCursor CURSOR
set @myCursor = CURSOR FAST_FORWARD
for
select distinct ticket_number, ticket_start_date, ticket_end_date
from penalties
where ticket_end_date <= @Today
open @myCursor
fetch next from @myCursor
into @colA, @colB, @colC
while @@fetch_status=0
begin
print @colA
print @colB
print @colC
fetch next from @myCursor
into @colA, @colB, @colC
end
close @myCursor
deallocate @myCursor
GO
-- =============================================
-- example to execute the store procedure
-- =============================================
EXECUTE simpleTest
GO
-------------
however this gives closed tickets but multiple records. I want only the last record details of the ticket_number.
I tried last(ticket_number) in my query, but it doesn't affect.
Please suggest! thanks.
I am using MS SQL server.
Hi..
I want to dynamically add column to a matrix.. this is what i have done so far...
1) Have a matrix control on my report...
2) added columns to it.. i want to may be add around 20 columns.. but at a given time there may not be more than 6 -10 columns. But if i add another column to the matrix it put it below the first column like this
Fields!NDesc1.value
Fields!NDesc2.Value
but i want to display it like this
Fields!NDesc1.value Fields!NDesc2.Value
How can i do it..
Can i have some step by step directions to do it...
any help will be appreciated.
Regards
Karen
Hi ...
There is a strange problem on my tables . When i execute a simple query from Query Analyzer, say select * from ' table name' , then i can edit or enter text in my result in one of the columns.
But the same table if i try to open through the Enterprise problem , i.e selecting the table , right click and select open table and then if i select return all rows , it does not allow me to enter text in a specific coloumn .
But the same is possible if i execute a query and try to enter text in the results which is displayed in grid from the Query Analyser .
Could anybody help me to know what could be the problem and how can i enter a text it ?
Many Thanks !!
Hello All,
I've a column of Date/Time type 'SenOn' in which NULL is allowed. If I enter some date in that column, and then next time again I want to make it empty (NULL I mean) there is an error that this value cant be changed.
Please note that there are no dependencies, so that is certainly not the problem.
Please help me this is really urgent.
We have a table with 1 million rows with duplicates in a column which allows nulls.Can we enforce uniqueness for only future inserts by anyway(ignoring the old ones)?
Thanks!
Hi
Can anybody tell me how can I find whether a column exists in my table or not???
Piyush
hi.
I have to update a column with new data. I have to replace the values that lay with a certain range. for example
my table has a column called ENI_KEYVALUE1, I have to update the data in this column only where the ENI_KEYVALUE1 is between P6_00001 and P6_00240. The values have to be replaced with values listed sequencially in an excel spreadsheet.
how do I do this???
thanks in advance
Hi,
this is my second attempt to get an answer to this question.
We want to strip our firstName column and lastname column of any punctuation that might be present.
What's the best of doing that?
Is my only choice to write a nested REPLACE for each character we want replaced (which will end up being very very long) or is there another way.
thanks
Zoey
How to assign multiple values to emp1 variable separated by comma
Ex: If ajay karthik vijay are employee names in emp table
then emp1= ajay,karthik, vijay
set emp1= (select employeename from emp) returns error
error: subquery returns morethan one value
I have a table with a identity column in sql server 7 database. Now i need to update this identity column. Directly i couldn't able to update this column since it is an identity column. So, i like to drop this identity nature first and then update it is easy to update it. For this purpose, I need a Transact-sql script. Please Let me know if you have any thoughts on this. Thanks.
View 5 Replies View RelatedI REALLY need to perform a JOIN and a GROUP BY on a CASE function column alias, but I'm receiving an "Invalid column name" error when attempting to run the query. Here's a snippet:
SELECT NewColumn=
CASE
WHEN Table1.Name LIKE '%FOO%' THEN 'FOO TOO'
END,
Table2.SelectCol2
FROM Table1
JOIN Table2 ON NewColumn = Table2.ColumnName
GROUP BY NewColumn, Table2.SelectCol2
ORDER BY Table2.SelectCol2
I really appreciate any help anyone can provide.
Thanks,
DC Ross
Hi,
I have a excel file which i want to import the data to sql server... The sql server Data type for that particular column is
varchar and it has a contraint too like the data should be in this fashion 00000-0000 or 00000...
but when i try to import the data from the excel to sql server... 08545 just becomes 8545 (cause excel is treating it as a float) and so my insert fails...
what can i do to rectify the problem...
regards
Karen
Hi every one,
I am facing problem in printing the reports from browser and also when i export it to pdf,the problem i am facing is blank pages are coming when report column getting the large amount of text around 2500 characters into column value.
can any one help me in this issue?. if the report is getting acceptable amout of data it is printing in proper way i.e no balnk pages at all.i maintained all properties like margins+body size < page size.
Choose an EEO-1 Classification: Increase all employees salaries that have: the selected EEO-1 classification by 10%.
Increase all employees salaries by 5%
Hi! I am new to SQL, but trying to teach myself. I have had lots of help from you guys and appreciate it very much. Today, I was trying to do the following:
In my table of "Employees", I have a column called classifications. I want to increase the salaries of the employees with a classification of EE0-1 by 10%, but I have not figured out to do so.
My second question is how would I increase all employees' salaries by 5%?
Anyone can help?
Thanks!
Scott
i have DB 2GB on disk.if i increase tha ram up to 4GB, the sql sever use with theram to his temporary table while process quiry?
View 1 Replies View RelatedHello all,
I have, what i think, is a unique problem that i'm hoping some of you can help me on.
I need to create a record number that is incremented by 1 whenever someone adds a new record to the database. For example, records numbering 1,2,3 are in the database. When the users adds a new record, SQL takes the last recordno, 3 in this case, and adds 1 to it thus producing 4.
Also, i need to have the ability to replace deleted record numbers with new ones. Using the example above, say a user deletes record number 2. Whenever someone adds a new record, sql would see the missing number and assign the new record that number.
I hope i'm making sense here. Does anyone have any ideas about this? Any articles on the web that someone could point me to?
Thanks.
Richard M.
Can someone tell me how I can write a stored procedure that will automatically increment the value of the index by 001? I am attempting to build a table for a menu system and I need to increment the index value of the document by 001 when submitted to the database. I also need to have the script obtain the last index value of the node before inserting new value.
All ideas appreciated.
Sincerely,
Tim
If interested, this requested is based upon an article written by Michael Feranda:
http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=7321&lngWId=4
Database's log file can not increase when nearly get 2 GB
Mine is sql server2000,What's wrong with this? Any idea about this?
Thanks
hi,
I have one DB in SQL Server 2005.When I was creating it
takes 7813 MB.Now the databse size almost full.Now I want to extend the
DB Size.At my HDD has more space(near by 160 GB).But I don't know how to
extend the Size.More over I had one doubt.Am executing the
exec sp_helpdb command.It shows the Datafile maxsize is Unlimited.I want to
know when the data is full,whether it automatically takes the size from the
HDD or not.
Please Help me out to this Problem.
We are getting the following error on an SSIS package:
"54 Diagnostic VirtualSQLName DomainUserName Load Daily 859CF005-CB7F-47D8-8432-AE7C074B343C 1A986F18-343F-4424-ABAB-AC6575187DF3 2007-02-14 10:05:42.000 2007-02-14 10:05:42.000 0 0x Based on the system configuration, the maximum concurrent executables are set to 4. "
Basically it is saying the we have reached the maximum amount of executables. How can we increase this value and where?
Thanks
I am really starting to like CTEs. My only qualm is that you can only use them within the first statement after you declare them. I wish they would remain active for the duration of the sql batch just like everything else (variables,local temp tables, ect). Is there any trick so that you can use them multiple times? Maybe define them as a string and do dynamic sql or something like that? Hopefully (i have not researched the new version of sql server) in SQL Server 2008 the scope has increase. Anyways any help would be appreciated.
thanks,
Ncage