|
<br />
DBCC CHECIDENT (tablename, RESEED, 0)
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Thanks But
I'd tried (test is table name)
DBCC CHECIDENT (test, RESEED, 0)
and also
DBCC CHECIDENT ('test', RESEED, 0)
And receive this error message
Server: Msg 2526, Level 16, State 2, Line 2
Incorrect DBCC statement. Check the documentation for the correct DBCC syntax and options.
have u any idea about that?
Thanks
Syed Shahid Hussain
|
|
|
|
|
My apologize it iwas my write mistake,the syntax is: DBCC CHECKIDENT (tablename, RESEED, 0)
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
|
Never mind dude,I am glad that worked for you.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
don´t worry with that let it be
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
hi all....
what is the difference between truncate and Delete...I have used following code but both are rollback....if anybody knows please reply me..
BEGIN TRANSACTION;
delete from one
rollback TRANSACTION
BEGIN TRANSACTION;
Truncate table one
rollback TRANSACTION
Thanks
Raaj
|
|
|
|
|
|
i have view with 2 columns name and salary i want to add a new column with id name the value of this column will changed every 3 rows one time
Example:
id name salary
1 ma 500
1 hh 300
1 uu 200
2 ff 100
2 rr 500
2 tt 111
3 re 333
---
--
-
thank you for help
|
|
|
|
|
You have to add new values in one of tables which is included in view.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
that a strange question?
can you insert the 3 row in one single procedure or add more columns?
what are you trying to achieve?
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
I really think you need to review your requirements.
|
|
|
|
|
Not enough experience to know a really silly request when it turns up. God knows what the real business requirement is?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
well, let's hope they get better with time.
|
|
|
|
|
For whatever reason, you could do the following...
select ceiling(cast(row_number() over (order by [field] asc) as float) / 3) as id, *
from [table]
Ryan
|
|
|
|
|
i think i know what are you trying to do.
that table has a foregn key in id column, you should not do that.
study database structure, download samples from microsoft; northwind or other.
i dont know your database but it could be like this
my_client
id(*) f_name l_name
2 nelson paixao
3 helen hunter
25 brian ferry
...
my_product
id(**) name price
34 spoon 2€
35 fork 1.5€
67 dishwasher 356€
...
my_sales
id data id_client(*) id_product(**)
12 1/2/07 2 34
13 2/2/07 3 35
14 2/2/07 3 67
17 3/3/08 25 35
...
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
If I have a table:
TAB1
PKey Col1StrName Col2IntDebt Col3StrItem
1 Michael 2.00 Toothpaste
2 Josh 3.00 Shampoo
3 Karen 1.00 Softdrink
4 Josh 2.50 Soap
5 Michael 5.75 Lollies
6 Michael 0.25 Pen
7 Karen 3.25 Milk
If I do a group by
I can aggregate the debts to:
Name Debt
Michael 8.00
Josh 5.50
Karen 4.25
With the following code:
select
Col1StrName as Name, SUM(Col2IntDebt) as Debt
from
TAB1
group by
Col1StrName
I would like to include a column such that:
Name Debt Items
Michael 8.00 Toothpaste, Lollies, Pen
Josh 5.50 Shampoo, Soap
Karen 4.25 Softdrink, Milk
What is the aggregate function to use for the string?
TIA!
----------------------------------------------------------
"unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep" - my daily unix command list
modified on Sunday, September 14, 2008 8:56 PM
|
|
|
|
|
There is no aggregate function to do what you want, it is a concatenation of the varchar fields, and there is no function available to do this. It would be nice if there was one as we see this requirements about once a a week here!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Can anyone teach me or show me some tutorials how to connect.. I need it badly..
|
|
|
|
|
Try this site
clickety[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
For example, given a table, I want to group it every 10/20/30 records per group.
One medthod is that create one view for each cases, in the example, I need create 3 views.
Because the views for the same exception the count of records per group, how to unify them
(take the count per group as a parameter)?
Thanks.
system
|
|
|
|
|
You cannot use a parameter with a view, it needs to be a stored proc.
Having said that you can do something silly like store the value in a settings table and then create a view that uses that value in the where clause thereby allowing you to change the grouping from elsewhere. Seems like another weird requirement to me, but you often see them here.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi!
I am facing problem in INSERT statement of SQL 2005 express. Actually I want to save data from one table to another two tables using SQL statement. I want to do something like that, when I will press Create button from DataGride Column. The data of that row of that Registration table will insert in some other table like Account and Directory. I have tried but I cannot do it. Please help me if anybody can.
|
|
|
|
|
Structure of two tables must be same for code down below,if structure is not same then in select command you have to specify columns which corresponding with destionationtable.
Insert into DestionationTable select * from SourceTable
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
there ae three tables, i want to save data from one table to other two tables using SQL query. Please help me
|
|
|
|