|
Sujit Mandal wrote: 1.where the mdf file located(is there any folder which is contain .mdf)
mdf and ldf file is located on shared folder (for example c:\abc or E:\abc)
folder abc is shared which i create programmatically
Sujit Mandal wrote: 2.when u r creating .bkp file always use overwrite existing file option.
i already check whether there are any file with same name. if yes, then first remove it and after that i create backup file
|
|
|
|
|
--> what is the problem with the following query... Actually i am running it against Access 2007 from VB.net 2008...
SELECT * FROM TBL_SALES where product_id=2 and customer_id=3 and dated='2009-10-01'
--> it works when i run it from SQL Server 2005... but doesn't work from dotnet... Need some suggestion from your side.. thanks...
J A Nasir K
|
|
|
|
|
Jamal Abdul Nasir wrote: doesn't work
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Read this article [^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
When you catch the exception in your VB code, what does it say?
|
|
|
|
|
i think so you are having time also with date check that and try to also format your date
Best Of Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
Well.. When you run this transact-sql statement.. probably you face that the datetime auto reformation like '2009-10-01' to CONVERT(DATETIME, '2009-10-01 00:00:00', 102). You should consider this..
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
I want to connect to my full SQL Server 2008 SP1 on a remote server over the internet using both VS.NET server explorer and MSSQLServer Management, and in both I failed!
I tried all the steps described in http://msdn.microsoft.com/en-us/library/ms345343.aspx[^] but I still cannot even telnet the remote server on the ports (1433 or the one I assigned as in the tutorial: 49172) ... BUT I can ping it and it replies.
I even closed the firewall application (NOD) on the server as I have full administrative remote desktop access to the server, and still no progress. (And I easily can connect to server using remote desktop)
I really need to connect to the server using SQL Server Management.
Thank you all
|
|
|
|
|
I once did this in the late 90s just to see if it could work, it did. I was then berated for connecting directly to the sql server via the internet for a number of security reasons.
That was DECADE ago when the internet was reasonably benign, you need to implement a communcations layer between your SQL server and your client, it is call a WEB SERVICE or WCF. You are then exposing a service to the big bad internet and not your bloody SQL Server.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
check is your server configured for remote connections and is it working locally or not and did you mentioned your dynamic port try this with odbc --> client configurations and assign port number to 1433 and check
Best Of Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
this code throw exception
hi guys
when i run the next code
it throw an exception
private void button1_Click(object sender, EventArgs e)
{
try
{
SqlConnection cn = new SqlConnection("initial catalog=vvvvvvvvvvv;server=.;integrated security=sspi");
SqlCommand cmd = new SqlCommand("back_up_database", cn);
cmd.CommandType = CommandType.StoredProcedure;
cn.Open();
int i = cmd.ExecuteNonQuery();
cn.Close();
if (i > 0)
{
MessageBox.Show("Your database is backed up");
}
}
catch(Exception ex)
{
MessageBox.Show("Sorry we can not back up your database");
}
}
but when i execute the stored procedure
ALTER proc [dbo].[back_up_database]
as
ALTER DATABASE [vvvvvvvvvvv]
SET OFFLINE
go
BACKUP DATABASE [vvvvvvvvvvv]
TO DISK = 'D:\SQLServerBackups\vvvvvvvvvvv.Bak'
with NO_COMPRESSION
go
ALTER DATABASE [vvvvvvvvvvv]
SET ONLINE
go
it completed successfully
so what is wrong
thanks for your interest
Mohamed El-Wehishy
|
|
|
|
|
Have you looked at the exception?
|
|
|
|
|
i can not understand you man
please explain your words
i want to know why this exception throwed
thanks for help
Mohamed El-Wehishy
|
|
|
|
|
Mohamed El-Wehishy wrote: this exception
what exception?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
you can see the first message
i wait your response
thanks
Mohamed El-Wehishy
|
|
|
|
|
Your code contains:
catch(Exception ex)
{
MessageBox.Show("Sorry we can not back up your database");
}
which is moronic, the ex variable contains a lot of information, which you should look at by showing it, say with Console.WriteLine(ex.ToString()); and instead you ignore it and then ask the world what is wrong??????????????????????????????????????????????????????????????????
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
comment try and catch and see what message it gives as error or you can write ex.message also to see the exception message
Best Of Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
Or he could just learn to debug the code by setting a breakpoint.
only two letters away from being an asset
|
|
|
|
|
I'm trying to create a stored procedure in MSSQL Server 2005 that'll perform the following jobs:
1) Create a login.
2) Create an user in TestDB database for the login created in step 1.
3) Assign the role 'db_generaluser' to the user created in step 2.
The login name and password for the login to be created will be supplied from externally through input parameters. If this procedure executes successfully it returns 0 else 1 to the caller through an output parameter.
When I try to compile it, it's prompting the following error messages:
Msg 102, Level 15, State 1, Procedure sp_CreateLogin, Line 23
Incorrect syntax near '@loginname'.
Msg 319, Level 15, State 1, Procedure sp_CreateLogin, Line 23
Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon.
Msg 319, Level 15, State 1, Procedure sp_CreateLogin, Line 27
Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon.
What's my mistake? Plz help. My code follows:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- ==========================================================================================================
-- Author: Priyamtheone
-- Create date: 2009-Oct-08
-- Description: This procedure is used to create a login, create an user in TestDB database associated to
-- that login and assign the role 'db_generaluser' to that user. The login name and password
-- will be supplied from externally through input parameters. If this procedure executes
-- successfully it returns 0 else 1 to the caller through an output parameter.
-- ==========================================================================================================
CREATE PROCEDURE [dbo].[sp_CreateLogin]
-- Add the parameters for the stored procedure here.
@loginname sysname,
@passwd sysname,
@intRetVal int = 0 output --Output parameter.
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from interfering with SELECT statements.
SET NOCOUNT ON;
SET @intRetVal = 0;
BEGIN TRY
CREATE LOGIN @loginname WITH PASSWORD=@passwd, DEFAULT_DATABASE=[TestDB], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
CREATE USER @loginname FOR LOGIN @loginname WITH DEFAULT_SCHEMA=[dbo]
EXEC sp_addrolemember N'db_generaluser', @loginname
END TRY
BEGIN CATCH
SET @intRetVal = 1; --Something went wrong. So set the return value to 1.
END CATCH
END
GO
modified on Friday, October 9, 2009 9:02 AM
|
|
|
|
|
hi
i looking for converting tool (better free) for
convert database oracle,sql server and access
from one type to another
thank's in advance
|
|
|
|
|
|
Doesn't Access have a wizard that can export to SQL Server as standard? Doesn't work with Oracle, though, since it's SQL Server-specific.
|
|
|
|
|
hi
i developed a program that will shows the rows for a specific table
for the specific database but this is not end of the store
there is another program that will changes the tables rows
my program has to sense the change immediately and do some thing special
"for example warn the user"
what can i do to sense these changes immediately and notify my program?
thanks in advance
|
|
|
|
|
you did not mention which db are you using in case of Sql Server, triggers can help you out
Best Of Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
hi dear softdev
i build a database named "Alarms" but this is not important !
please attention !
i want to notify my windows application , not to notify any other objects in sql server!!!! (how can i use triggers to notify an application?)
and both of application and database will run in a local computer
perhaps i have to use "notification service"
but it is hard to implement and distribute it !
is there any other solution ?
pleeeeeeeeeeeeeeaaaaaaaaase help me!
|
|
|
|