|
marwan_siala wrote: the .mdf file on PC1 "C:\DB.mdf" ... what should the connection string used on PC2?
SQL Server is not a file based database system. It is a server based database system. You cannot connect to files (SQL Server 2005 does give you an illusion that you can, but it temporarily connects the file to the server)
In short: You connect to a server, not a file.
marwan_siala wrote: and how can i permit the SQL Server to accept network connections
I really need more details... For example, the version of SQL Server.
|
|
|
|
|
from SQL Server Configuration Manager ( Version: 2005.090.3042.00 )
i dont know if thats the version you asked..
about the connection what should i do to make PC1 and PC2 access the same file
|
|
|
|
|
marwan_siala wrote: about the connection what should i do to make PC1 and PC2 access the same file
You don't you get the sever local to the file access it and then connect to the server. As I already told you: SQL Server is a server based database, not a file based database. You connect to the server.
First, to allow network access:
Go into SQL Server Configuration Manager. Open "SQL Native Client Configuration"-->"Client Protocols" and ensure that "TCP/IP" is enabled.
Then open "SQL Server 2005 Network Configuration"-->"Protocols for <instance name>" and ensure that "TCP/IP" is enabled.
Then go into "Microsoft SQL Server Management Studio" and connect to the relevant server. Once connected, open up the databases. If the database is not there, then right-click on "Databases" and attach the file that you want.
Then in your application you connect as normal, specifying the name of the machine that is running the SQL Server.
|
|
|
|
|
i don't know where "Microsoft SQL Server Management Studio" is? i could not find it??
|
|
|
|
|
marwan_siala wrote: i don't know where "Microsoft SQL Server Management Studio" is? i could not find it??
because i was using the express edition ... now i have SQL server 2005
but when i need to access the database in PC1 and PC2 a message apear telling me that "the default settings SQL server doesn't allow remote connections"
what shuld i do?
thanks
|
|
|
|
|
I written strored procedure as below
create procedure testProc
@param varchar(100)
as
select * from authors
where au_id in (@param)
when i, execute this with following parameters, it gives me error. I execute it like this..
exec testProc('''2104206'',''123''')
Regards
PVC
|
|
|
|
|
parasu_516 wrote: exec testProc('''2104206'',''123''')
Change this to exec testProc('2104206','123')
How can you pass two values to procedure when the procedure accepts only one ?
http://w3hearts.com/articles/6/[^]
|
|
|
|
|
Actually you need to change it to be
exec testProc('2104206,123')
If you look at what the SP is trying to do he wants to be able to pass in a range of values and return those details which are in the LIST of items as a single parametr.
Now I'm not even going to get started on WHY this is dangerous for security - but this will make it work......
Mark.
|
|
|
|
|
|
Hi,
If we create a stored procedure where and how is it saved and how is error handling done to the procedure. If any error occours where is it thrown. Help me.
Thanx,
Yamini.
|
|
|
|
|
yaminilatha wrote: where and how is it saved
Inside your database.
yaminilatha wrote: how is error handling done to the procedure
You can do error handing inside the proc by checking the @@error value.
yaminilatha wrote: If any error occours where is it thrown.
If things break bad enough, you'll get an exceptin thrown in your calling code. But, you can handle most errors in your proc.
It really is hard to say more, without knowing what language you're using to call the proc. .NET languages define exceptions you can catch that are specific to DB calls.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I am using C#.net. My question in the interview was how do you perform error handling in sql server when you create a stored procedure.Where are the errors thrown not in .net in sql server.
yamini
|
|
|
|
|
yaminilatha wrote: If we create a stored procedure where and how is it saved and how is error handling done to the procedure. If any error occours where is it thrown. Help me.
Check the following link to get idea about procedures
http://w3hearts.com/articles/6/[^]
|
|
|
|
|
Thanx, this site was very useful.
|
|
|
|
|
Hi all,
I want to store Word document in SQL Server. Who can help me?
Datatype? Input? Example?
Thanks for reading this question.
|
|
|
|
|
It will be a BLOB, I would think.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thank you very much
|
|
|
|
|
|
I'm using VB.NET 2005
Thanks you.
|
|
|
|
|
i have a gray scale image.(24 bit bmp format). how do i store it in a database.
i am using SQL Server-2003.
Also this server has a data type called 'image' but i am not able to use it.
please help.
thanku all.
|
|
|
|
|
There isn't a SQL Server 2003. I take you mean 2005.
http://www.codeproject.com/aspnet/PicManager.asp[^]
Grady Booch: I told Google to their face...what you need is some serious adult supervision. (2007 Turing lecture)
http:\\www.frankkerrigan.com
|
|
|
|
|
sorry i meant to state sql server 2000.
|
|
|
|
|
|
Hi All
I had a hard disk failure this morning hard disk(HD) c: so i replaced the HD and installed sql 2000 sp3 i have a back up for my data base on other HD D: i have 1 mdf and around 30 ldf.
My problem is that iam receiving an error 5712 not a valid database file header. PageAudit property is incorrect.
I googled so i found this error occurs when attaching db in old version like from sql 2000 to 7.0, but this case isnt applicable on my issue. I tried aslo exec sp_attach_db still giving same error on one ldf file.
How can i fix this? it is urgent my db is down.
I tried also to create a new db with same name and replaced the mdf but didnt work. Kindly note iam not a data base admin and i have no enough knowledge in this subject.
|
|
|
|
|
Hi everyone
I've done a Windows application in C# where I can retrieve data from a database. But I want to port my database records to a server and then let my Windows appl. getting the the through the internet. Do you know of some easy way to handle this problem...
All the best
Al
NB I'm using ADO.NET for querying
|
|
|
|