|
You created the db and you don't have permissions?
“Some have an idea that the reason we in this country discard things so readily is because we have so much. The facts are exactly opposite - the reason we have so much is simply because we discard things so readily. We replace the old in return for something that will serve us better.”--Alfred P. Sloan
|
|
|
|
|
Hi there.
I want to know, if i am using an Select statement in SQL, and it should return a value, but returns Null, how do i set the null value to a '0'?
Thanks
|
|
|
|
|
SELECT ISNULL(fieldname, '0')
|
|
|
|
|
Hi all,
Last weekend i had a hard disk crash. I changed the hard disk and iam using sql2000 sp3. I had a back up on another disk. But when i attempt to attach the mdf file it gives me the following msg:
Error 5172 the header for file G:\ADMIC\db.ndf is not a valid database file header. the page audit property is incorrect.
Devise activation error. The physical file G\ADMIC\db.ndf may be incorrect.
Could not open new database ADMIC. Create database is aborted.
Kindly note that the message is labelled Microsoft SQL-DMO(ODBC SQLState: 42000)
Any help is appreciated.
|
|
|
|
|
i have two month records in my table........,
example:
table look like this:
id date remarks
1 02/28/2006 test1
2 02/24/2006 test2
3 03/31/2006 test3
4 03/12/2006 test4
5 03/12/2007 test5
if i tell month on "3" and year on "2006" then it want to display...,
id=3 & 4 only...............,
how to do this one......,
plz hlp me......
Regards,
Magesh,
Magi
|
|
|
|
|
Hi
You can filter using Month() and Year() functions.
For example:
Month(DateColumn) = 3 and Year(DateColumn) = 2006
Harini
|
|
|
|
|
Can I have your email pls ?
|
|
|
|
|
DooDooo wrote: Can I have your email pls ?
No, you may not have my email.
|
|
|
|
|
Hi Everyone!
I'm trying to create a new database file from XSD schema and then populate the empty SQL database with a DataSet. The major problem is to create a table from XSD schema file. I'm using SQL Server 2005 Compact Edition and VS 2005.
File.Delete("Test.sdf");
string connString = "Data Source='Test.sdf'; LCID=1033; Password=\"s$;2'!dS64\"; Encrypt = TRUE;";
SqlCeEngine engine = new SqlCeEngine(connString);
engine.CreateDatabase();
engine.Dispose();
SqlCeConnection conn = new SqlCeConnection(connString);
conn.Open();
DataSet dbSet = new DataSet("myDataSet");
dbSet.ReadXmlSchema("myData.xsd");
dbSet.EnforceConstraints = false;
dbSet.ReadXml("myData.xml");
...
conn.Close();
Any help would be greatly appreciated.
Gywox
-- modified at 10:34 Thursday 29th March, 2007
|
|
|
|
|
i have 2 computers. first its name is PC1 with ip 192.168.0.1 and the other PC2 192.168.0.75
PC1 has the SQL database and PC2 should access the database
i do not know how to make PC2 access the Database in PC1...
need help on that please
thanks allot
|
|
|
|
|
This answer assumes you are using SQL Server:
The connection string will refer to the name PC2, or you can use its IP address. You must also permit the SQL Server to accept network connections.
|
|
|
|
|
i really need more details...
the .mdf file on PC1 "C:\DB.mdf" ... what should the connection string used on PC2?
and how can i permit the SQL Server to accept network connections.
|
|
|
|
|
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/[^]
|
|
|
|