|
OK, thank you, I'll think along the lines of DELETE and INSERT.
The next step is to have this work with an SqlDataSource1_Updating method with my Gridview control in C#.
Thanks to all for your help.
|
|
|
|
|
i'm trying to execute the "sp_databases" proc in sql sever 2008 express as "sa" but it doesn't return any value even though there
are two customer created DBs available. what must be the problem.. any idea about this issue.
thanx in advance.
|
|
|
|
|
what happens if you execute
select * from sys.databases
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
hmm i get all the DBs in the server . at the same time a found some articles saying that there is a permission problem
i used
USE master;
GRANT EXECUTE ON OBJECT::dbo.sp_databases
TO public;
GO
but still get the "Cannot find the object 'sp_databases', because it does not exist or you do not have permission."
message.
and also in the same machine i have another standard instance is installed and running, but there i get the list of DBs with
this sp_databases.
have any idea...
thanx in advance..
|
|
|
|
|
try
exec master..sp_database
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
exec master..sp_databases executes but it shows nothing
|
|
|
|
|
|
sys.database is a system table introduced with SQL 2005 and used in sql 2008
where sp_database is an actual stored procedure that has been present since sql server 2000 I believe
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
I guess I will wake up sooner or later.
The sp is sys.sp_databases
|
|
|
|
|
oh that something new learnt today it also works executing it on sys.sp_databases too
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
using RowNum? who can tell me the RowId in last Column? what's effect?
|
|
|
|
|
openboy2010 wrote: using RowNum?
SELECT ROWNUM, T.*
FROM TEST_TABLE T
ORDER BY ROWNUM
openboy2010 wrote: who can tell me the RowId in last Column?
SELECT C.ROWYOURBOAT
FROM
(SELECT COUNT(*) AS ROWCOUNT
FROM TEST_TABLE T
) A,
(SELECT ROWNUM AS ROWCOUNT, ROWID AS ROWYOURBOAT
FROM TEST_TABLE T
ORDER BY ROWNUM
) C
WHERE A.ROWCOUNT = C.ROWCOUNT
openboy2010 wrote: what's effect?
I don't know what your are asking here...
modified on Thursday, December 30, 2010 11:03 AM
|
|
|
|
|
the last sentence means what's the RowId's effect?
|
|
|
|
|
The RowID's affect on what?
|
|
|
|
|
if we sort a table ,can we using the RowID sort ? I'm a Chinese Student,My Written English is not very well.
|
|
|
|
|
openboy2010 wrote: My Written English is not very well.
That's ok it is good enough, I just wanted clarification so I can answer your homework question appropriately.
RowID is a column generated by oracle to map to that particular row.
If you sort by RowID instead of RowNum, the results may not be the same. RowNum is a column generated by Oracle from the RESULTS of the Select Query.
|
|
|
|
|
|
Hello All,
I will be designing a new database and wanted to read an article to make sure all grounds are covered while implementing this.
I know the need for good naming convention, primary keys, foreign keys, indexes. Make sure to have a schema set up. This is in SQL server 2005.
Anything else? Any articles that has helped you through the process, please do send me.
Thanks for all your help!
Vani
|
|
|
|
|
There is a series of articles by Joe Celko 'Stairway to Database Design' Step 1[^], I think there are 6/7 in the series. You may have to sign up to read them (can't remember) but it is a useful site for database stuff anyway.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Normalize![^]
"When did ignorance become a point of view" - Dilbert
|
|
|
|
|
hi..
i'm trying to retrieve the data from database using ssis package..
database name is employee which contains 48 tables and it is around 20GB of memory.. it is a production
database..
now what i want is to retrieve the data for each four hours..
i.e i want to execute the package for every 4 hrs..
now what i did is i have taken a database transfer task and from the
source i.e production database i want to transfer to my database
which works fine..
but what is the problem here is for every 4 hrs whole DB is replaced in my system
i've given overwrite TRUE..
Here user enter the data into database for every 4 hour is minimum 10 MB of data..
instead for replacing the whole database for every 4 hrs is there any
solution that what user enter data into database only that much amount of data should be append into my system.. is it possible
please help me..
|
|
|
|
|
Have you thought of doing a maintenance plan?
It will allow you to do full backups and differential backups on a given schedule
Maintenance plans[^]
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
Hello,
I would like to write a select statement at the database server level, like trying to find all the existing indexes for all the databases in that server - something like this? But for all the databases in that given server and not individual database servers. This below piece works only for each databases.
--
select t.name, i.name
from sys.tables t, sys.indexes i
where i.object_id = t.object_id
--
thanks!
|
|
|
|
|
AFAIK It's not implicitly possible with T-SQL as Particular index information is not stored globally, It's in corresponding DB.
But there's some suggestion that you may apply to get.
a) Get name of all the database in Server
select name from master.dbo.sysdatabases
b) Take database one by one from the above query result and make a custom query and execute it using EXEC statement.
Like
Use
select t.name, i.name
from sys.tables t, sys.indexes i
where i.object_id = t.object_id
c) Store each result in one temperory table with the required column.
d) Finally SELECT * FROM #Temptable
I Hope you are getting me.
|
|
|
|
|
Thanks for the reply, Hiren.
I have tried to use the cursor to loop through all the databases, passing in one database at a time to th inner cursor at the master level database. But it is not getting the correct results.
I believe you cannot use the reserved word USE in stored procs?
|
|
|
|