|
thank u very much.
My problem have been solved
|
|
|
|
|
how to copy all records in one database to another database table in sql server 2005
|
|
|
|
|
insert into table2(column list) select (column list) from table1
not really difficult is it?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
It can also be done via SQL Server Management Studio, Object Explorer, Tasks and SQL Import and Export Wizard. I use this method as I have around 10-13 tables and their data to be moved from one database to another.
|
|
|
|
|
Hi,
It is quite annoying problem and I couldn't figure out what is causing it. The problem is:
When I invoke a stored procedure inside a sub procedure, it is working fine. However, when I try to invoke a stored procedure when I submit the web page, none of stored procedures are working even connection string and and assigned parameters are true as it can be seen below. "I get too many arguments error"
When I use a query in the aspx page, it works but when I invoke a stored procedure I get error message. What could cause the issue related to SQL SERVERS EXPRESS 2008?
<br />
<br />
'THIS IS THE CODE INSIDE AN ASPX FILE<br />
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:HolidayDBConnectionString %>" <br />
InsertCommand='StoredProcedure1' <br />
<br />
<br />
SelectCommand="SELECT DISTINCT [ActivityName] FROM [Activities] ORDER BY [ActivityName]" <br />
InsertCommandType="StoredProcedure"><br />
<InsertParameters><br />
<asp:Parameter Name="GetActivityName" Type="String" /><br />
</InsertParameters><br />
</asp:SqlDataSource><br />
<br />
<br />
'HERE IS THE STORED PROCEDURE<br />
<br />
ALTER PROCEDURE dbo.StoredProcedure1 <br />
(<br />
@GetActivityName nvarchar(50)<br />
) <br />
AS<br />
<br />
<br />
INSERT INTO Activities VALUES (@GetActivityName)<br />
<br />
<br />
RETURN<br />
<br />
<br />
<br />
'HERE IS THE TABLE DEFINITION<br />
<br />
[PK] ActivityNumber bigint (IDENTITY COLUM) ALLOW NULLS FALSE<br />
ActivityName nvarchar(50) ALLOW NULLS FALSE<br />
<br />
<br />
Thanks.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
First, change this line
INSERT INTO Activities VALUES (@GetActivityName)
to this
INSERT INTO Activities(ActivityName) VALUES (@GetActivityName)
and possibly try forcing your asp application to totally restart -I have seen similar problems due to caching with web apps.
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
There is no need to define it in SQL EXPRESS 2008 as at the way you presented. You don't have to define Activities(ActivityName) after INSERT INTO.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
JUNEYT wrote: There is no need to define it in SQL EXPRESS 2008 as at the way you presented. You don't have to define Activities(ActivityName) after INSERT INTO.
Possibly not, but its good practice to define which columns you are inserting into. In this instance its easy, but if you had a table of 200 columns it would be a major headache.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I second that.
As I recall it hasn't been mandatory to list target fields since mid 90's (depending on the db), but it sure helps (especially afterwards when little bit adding fields, renaming them and dropping a few )
The need to optimize rises from a bad design
|
|
|
|
|
I need some pointers please. My friend Google overwhelms me when I ask "Distributed systems designs" or something similar.
We need to design a system with a 1000+ smallish and geographically distributed sites, each with a significant percentage of local, but volatile data. Think a distribution company with 1000+ outlets with "virtual stock" (thats voucher numbers which have real value). Each outlet has its own stock levels and customers but needs to know in realtime info of customers at other sites and global stock levels and goodness knows what else.
A somewhat reliable VPN is available to all sites.
Options:
1. I do not think this is a scenario where we occasionally update a central server with all local transactions (aggregate or even detailed), the data is too shared and needs to be near realtime for a significant proportion of the time.
2. Having one Hulk-sized setup centrally should work fine, but you cannot bring each site to a halt when there is a problem at the central server or the line to it has gone bad.
3. My idea is to use the one central hulk-sized server when all goes well, thereby avoiding all the distributed complexities (most of the time), but to switch over to a local DB when the line or central server goes bad, so that at least a significant proportion of transactions can continue.
Is Microsoft's Dryad any good here ?
Thanks in advance
|
|
|
|
|
Seems like you have a headache coming...
Seriously, if not already done so, read about the concepts (for example from BOL) for:
- distributed transactions (two-phase commit and especialy DTS in Microsoft world)
- linked servers
- transactional replication
- service broker and message queues
These should give you info on somewhat different technologies for distributed systems at database level.
Hope this helps,
Mika
The need to optimize rises from a bad design
|
|
|
|
|
Hi
First of all I have to say, that I'm in no way an SQL expert more likely an SQL dummy, so be warned.
I'm am currently building an InnoSetup installer hierarchy and as a part of that I have made a prerequisite downloader+installer for various Microsoft items - .NET Frameworks, Windows Installers, Internet Explorers, MDAC etc.
To detect the various components I use mostly registration keys, but as I played around with SQL Server 2005 Express I found out, that registration keys wasn't a good way detect it. Instead I tried creating an Ole object like this:
function SQLServerExpress2005Exist(): Boolean;
begin
Result := True;
try
SQLServer := CreateOleObject('SQLDMO.SQLServer');
except
if MsgBox(CustomMessage('SQLServerExpress2005Msg'), mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then Result := False;
end;
end; This method works when trying to detect an SQL Server 2005, but when I try using the same method on my computer with a running SQL Server 2008 Express, it doesn't work i.e. the code enters the except block.
What is the best way to detect an installed (not necessarily running) SQL Server 2008?
I'm in the high-fidelity first class traveling set.
And I think I need a Lear jet.
|
|
|
|
|
try System.Data.Sql.SqlDataSourceEnumerator.Instance.GetDataSources();
|
|
|
|
|
That looks like a .NET library and I can't use .NET in InnoSetup - not directly anyway and I can't be sure of which .NET version is on the target machine, and if it has one at all.
InnoSetup code is written in Pascal, so what I really need is a Pascal way of doing the check.
I'm in the high-fidelity first class traveling set.
And I think I need a Lear jet.
|
|
|
|
|
I take some time on form & save it in datatable i.e. login time
then that time is in running condition as per system time,when user in working condition the current time is to be saved automatically after each 5 min.
is there any trigger fired on it within 5 min.each?
give be brief idea of that???
or any different way??????
|
|
|
|
|
g_amol wrote: I take some time on form & save it in datatable
If you are using windows forms then look at adding a timer.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
can u give me a brief idea @ that???????
|
|
|
|
|
As I said, add a timer to your form to fire every 5 minutes.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
you have to do that in c#, you are in the wrong forum!!!
like he said add a timer control in your form,
set interval propriety for 5 min
add event timer_tick and place your code inside
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
hi!
can i change the column position of the existing table in sql server2000.
or
can i place my new column in first position on creation time.
|
|
|
|
|
ahmad25 wrote: can i change the column position of the existing table in sql server2000.
Yes, but why? Columns should be referred to be name, not position, so the position is not relevant.
If you must do it, then go in the management studio, go to design table, make the chaneg but instead of saving look on the menu for something like 'Create Change Script'
I don't have sql server 2000 installed, so I can't remeber the extact location in the management studio, but you should be able to spot it.
ahmad25 wrote: can i place my new column in first position on creation time
Of course. Just put it first in your create script.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
THANKS A LOT BOB.
MY PROBLEM HAS BEEN SOLVED.
BUT I THINK I COULD NOT EXPLAIN MY SECOND PROBLEM.
i.e. I WANT TO ENTER OUR NEW COLUMN IN FIRST POSITION IF MY TABLE HAS ALREADY CREATED.
IF THIS POSSIBLE PLEASE HELP ME, OTHERWISE IT'S OK.
AGAIN THANKS.
BYE
|
|
|
|
|
Regardless of position, if you go into the table designer, add the column where you want it (first, middle, anywhere) then you can generate ascript to do it, nut be warnd, on a big table it will take a while to run.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
forget that, let it be.
what do you want to achieve?
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
For example,
SELECT * FROM sub_query
Can the sub_query contain a CTE?
I want to optimize sub_query by not changing anything outside sub_query.
Thanks.
professional
|
|
|
|