|
You still haven't said what databse engine your using.
Access, Sql Server, MySQL?
If it's file based like Access you could just take a direct copy. If its server based like Sql Server you could just take a backup.
|
|
|
|
|
i m using Access.
yur thankfull
|
|
|
|
|
If You can give me coding in C# or Vb.net or you can give me logic
|
|
|
|
|
As Colin Angus Mackay said, check out the FileInfo class, the File class would do it too. Both live in System.IO
|
|
|
|
|
|
It is actually a test for other users on how powerful is thier vocabulary. Remember in the school days English classes, there used to be an exercise where a passage with just hints would be given and We need to rewrite it as a flowing content.
|
|
|
|
|
Hi experts,
I want to change value of an identity column without dropping table / references / constraints / deleting rows from that table.
I am using SQL server 2005 and I have tried to modify the column as identity seed to NO using MS SQL Server Management Studio but it is hanging.
Is there any SQL statement to modify that column as Identity Seed to NO.?
Harini
|
|
|
|
|
Harini N K wrote: I am using SQL server 2005 and I have tried to modify the column as identity seed to NO using MS SQL Server Management Studio but it is hanging.
This normally indicates that there are existing connections open that have taken Schema Stability locks on the table. These locks should be shortlived - check for transactions that haven't been committed or rolled back.
To disable the identity feature completely, use ALTER TABLE table ALTER COLUMN column_name data_type . It sounds, though, as if you want to set the identity value of some existing rows, or set the identity value of new rows you're inserting. To do this, use SET IDENTITY_INSERT table ON . It's normally a good idea to turn this off when you're done. Also, use DBCC CHECKIDENT to ensure that the next row inserted which uses the identity value does not get a clashing value.
|
|
|
|
|
I use INNER JOIN for a multi-part identifer tbl1 a and tb1 b
But I can't find solution for select another table (exam: tbl2)
This is the code:
select a.field1,..
from tbl1 a
inner join
(select field1,.. from tbl1 group by field1,..) b
on a.field1 = b.field1 and ..
group by a.field1,..
I want to select another field(exam:field3) from tbl2, my code
select a.field1,..,tbl2.field3
from tbl2, tbl1 a
inner join
(select field1,.., from tbl1 group by field1,..) b
on a.field1 = b.field1 and ..
group by a.field1,..,tbl2.field3
The Question is: where I put the code:
a.field1 = tbl2.field1
Thanks a lot !!!
|
|
|
|
|
masyarial wrote: select a.field1,..,tbl2.field3
from tbl2, tbl1 a
inner join
(select field1,.., from tbl1 group by field1,..) b
on a.field1 = b.field1 and ..
group by a.field1,..,tbl2.field3
The Question is: where I put the code:
a.field1 = tbl2.field1
<br />
SELECT a.field1,..,tbl2.field3<br />
FROM tbl2 <br />
INNER JOIN tbl1 a ON a.field1 = tbl2.field1<br />
INNER JOIN (select field1,.., from tbl1 group by field1,..) b ON a.field1 = b.field1 and ..<br />
GROUP BY a.field1,..,tbl2.field3<br />
Regards
KP
|
|
|
|
|
Any advice from you guys where I can find easy to read and digest SQL tutorials?
Thanks a lot
Dom
|
|
|
|
|
Your post is VERY general. For basic SQL tutorials just type in a few keywords in this fancy-shmancy new thing called GOOGLE.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
Wow thats just great! I never thought we have the same brain waves I know I have it in me..
You've just enlighten me
Thanks Lecky
Now I can be a gold member, UTFG you guys
SNORE
Dom
|
|
|
|
|
firestoper wrote: You've just enlighten me
Before Posting the questions in the forum you should get ti cleared by some of our Friends like google and other tutorials.
After that only we could post the question in the forum.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Not exactly a way to ensure you can get help in the future. Your sarcastic, rude response will be remembered, and will impact the likelihood that someone will help you in the future.
Clearly you had not read the "how to get help" at the top of the page before you posted, and Lecky was only reminding you quite properly of that.
Good luck in the future. Your crappy attitude should carry you far.
|
|
|
|
|
(1) SQL TUTORIAL[^]
(2) w3schools[^]
Hope this links will give an idea about the sql for you.
And these links cover the basic details.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Sweet, just what I need
Thanks Satips
Dom
|
|
|
|
|
Glad to help always
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
|
suppose I have a table like this
create table MyTable(
varchar(10) s1,
varchar(10) s2
)
let an example for data in MyTable be
s1 s2
------------------------------
manager1 null
manager2 null
clerk0_1 manager1
clerk1_1 manager1
clerk2_2 manager2
clerk3_1 clerk0_1
clerk4_1 clerk1_1
clerk5_2 clerk2_2
clerk6_1 clerk4_1
the table says that s1 is the boss of s2. if s1 does not have a boss then s2 is null.
(I wrote a skeleton sql statement so that you can easily understand, please can you write a proc or sql statement)
I want a SQL statement like this
select s1 from MyTabe [please fill in here] where s1 = 'manager1'
so that the query will return
s1
---------------
manager1
clerk0_1
clerk1_1
clerk3_1
clerk4_1
clerk6_1
I mean starting from manager1 select recursively down to the last leaf. It is like given a tree select the root and all its leaves and the leafs of that subleaf and so on until all is out. Please note that there is no fixed level. The query ends when all the sub leaves are displayed. Can you please do it please?
|
|
|
|
|
rajugrover wrote: the table says that s1 is the boss of s2. if s1 does not have a boss then s2 is null
Then why not give the columns meaningful names. s1 = employee; s2 = manager
rajugrover wrote: I mean starting from manager1 select recursively down to the last leaf.
I've done this before - it is a difficult and time consuming query. SQL isn't so good at recursion. What I did was create a trigger so that when data was inserted, updated or deleted a denormalised version of the table was updated. If I needed to know everyone from PersonX downwards I could just query the denormalised table.
The denormalised table contains just two columns the superior and the subordinate. I'm presuming the table you show has more columns. The denormalised version can then be joined with the normalised version to get any additional data.
Unfortunately, off the top of my head, I don't remember how it was implemented so I can't give you code right now. But hopefully the above should guide you in a reasonable direction.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Colin Angus Mackay wrote: SQL isn't so good at recursion
THats why I love being able to use CLR stored procs in 2005. I try to stick with TSQL as much as possible but there are some problems, like recursion, that a bit of C# can do wonders with
|
|
|
|
|
You aren't going to get anybody to actually do your work for you. It's up to you to figure out how to do it - if you don't, how are you going to be able to maintain it. I will give you a big hint here though, if you are using SQL Server 2005 - take a look at recursive queries with Common Table Expressions (CTE).
|
|
|
|
|
Pete O'Hanlon wrote: It's up to you to figure out how to do it - if you don't, how are you going to be able to maintain it.
Very valuable word of wisdom there, Pete.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Thanks.
I sometimes wonder at these people. Have they no pride in their work? Do they never have to support the crap they foist on their clients?
|
|
|
|