|
Thank you very much,i understand
Vuyiswa
|
|
|
|
|
Mike Dimmick wrote: You'll have to weigh these issues up
... before deciding whether or not DST is a good idea in the first place. (It isn't.)
|
|
|
|
|
set the value as getdate() into that column
|
|
|
|
|
Hi Thank man,tell me Do you know how can i take input from a vb and insert into a table using stored Procedure. i have created the Stored Procedure, i have connected to the Sqldb, i have created the parameter object i have a problem in Appending
can you help
Vuyiswa
|
|
|
|
|
I have Sql Server 2005 Express installed in my PC and have some database in it. I also have a Laptop where I installed Sql Server 2005 Express too. Is possible to transfer the databases from the my desktop PC to the laptop Sql Server 2005 Express?
|
|
|
|
|
Make a backup on your PC then restore it to the laptop.
|
|
|
|
|
Colin Angus Mackay wrote: Make a backup on your PC then restore it to the laptop.
Is this a better method than detach and attach?
"We are all repositories for genetically-encoded information that we're all spreading back and forth amongst each other, all the time. We're just lousy with information."
- Neal Stephenson
|
|
|
|
|
Jerry Hammond wrote: Is this a better method than detach and attach?
I would say so. Apart from anything else, you only have one file to transfer.
|
|
|
|
|
Thanks. My knee-jerk thought was to detach and attach, but upon reading your explanation further down in this thread I undertsand now why it would not be the optimum choice of action.
"We are all repositories for genetically-encoded information that we're all spreading back and forth amongst each other, all the time. We're just lousy with information."
- Neal Stephenson
|
|
|
|
|
You could also detach the database and then copy the mdf and ldf files over to the new machine. You will have to reattach the files on the main machine and the laptop. The whole point of detach and reattach is to provide a means to share databases and it is allot simpler than backing up and restore method.
_____________________________________________________________________
Our developers never release
code. Rather, it tends to escape, pillaging the countryside all around.
The Enlightenment Project (paraphrased comment)
Visit Me at GISDevCafe
|
|
|
|
|
Aaron VanWieren wrote: The whole point of detach and reattach is to provide a means to share databases
Move, not share.
The whole point of a server based database system is that you don't end up with multiple copies of a database and end up with a complete mess because you no longer know which is the definitive version. This happens a lot with Access.
Aaron VanWieren wrote: it is allot simpler than backing up and restore method
Well, with backup and restore you only have one file to deal with. With detach and attach you have to deal with a minimum of two files and, depending on how your database is set up, it could be a lot more than that. Not only that but the database could span various disks. Heck, it is even possible that SQL Server just takes over an entire disk - so there are no files to detach at all, just a physical disk.
|
|
|
|
|
Good points. Sorry in the over simplification. It really depends on the database specifics.
_____________________________________________________________________
Our developers never release
code. Rather, it tends to escape, pillaging the countryside all around.
The Enlightenment Project (paraphrased comment)
Visit Me at GISDevCafe
|
|
|
|
|
When you post a question like this, you need to provide more information than this. For instance, which database are you using? This does play an important part in answering this question.
If you are using SQL Server 2005, you can use a Common Table Expression (CTE) to solve this problem. There are many examples that you can use for this.
In earlier versions of SQL Server, you will need to do some real hacking at code.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: When you post a question like this, you need to provide more information than this.
Looks like he didn't want to provide more information.
|
|
|
|
|
Colin Angus Mackay wrote: Looks like he didn't want to provide more information.
Looks like it. Probably homework and the teacher's looked in.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Using ADOX (in C# form application) to update a Jet 4.0 database
Supposedly I should be able to change a column’s REQUIRED property by using this code:
cat.Tables["Products"].Columns["ItemReorderDate"].Properties["Nullable"].Value = true;
Found at:
http://msdn2.microsoft.com/en-us/library/aa140022(office.10).aspx
Unfortunately, it gives this error:
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
Is ADOX “Nullable” not compatible with Jet 4.0?
If not, is it possible to change the REQUIRED property to "NO" by a SQL command for Jet 4.0?
Thanks,
Ron
|
|
|
|
|
Hi,
I'm tired of searching a way to save and load an image from a SQL Server 2005 database.
There are lots of examples that explains that, but in the process of saving I don't know why the most part of byte array that contains the image simply disapear...
Can anyone tell me, please, how can we save an image in a SQL Server 2005?
Thank you!
P.S.: I'm using VB.NET 2005.
Miguel Castanheira
|
|
|
|
|
|
Thank you, but I already use that kind of sample with C#.
Unfortunately, I think that the problem is in VB.NET...
I'm need that code to work on VB.NET, because when I use C# it realy works good!
Can you explain me why?
Miguel
|
|
|
|
|
Here is a section of an object I use to solve the issue. _bm is a Bitmap and _ms is a MemoryStream. You should be able handle it from here.
public void Load(object dbField)
{
Clear();
if (dbField != DBNull.Value)
{
byte[] buf = (byte[])dbField;
_ms = new MemoryStream(buf);
_bm = (Bitmap) Image.FromStream(_ms);
}
}
public object Save()
{
if (_bm == null)
{
return DBNull.Value;
}
else
{
MemoryStream ms = new MemoryStream();
_bm.Save(ms,_bm.RawFormat);
byte[] buf = ms.GetBuffer();
ms.Close();
return buf;
}
}
|
|
|
|
|
Thank you, but I already use that kind of sample with C#.
Unfortunately, I think that the problem is in VB.NET...
I'm need that code to work on VB.NET, because when I use C# it realy works good!
Can you explain me why?
Miguel
|
|
|
|
|
|
can anyone correct for me this:
CString strText;
CString strSQL;
CDaoDatabase db;
db.Open("D:\\copyktt.mdb");
m_cedit.GetWindowText(strText);
strSQL.Format("INSERT INTO Table6 SELECT * FROM Table3 IN 'C:\\ktt.mdb' WHERE MyField = %s",strText);
db.Execute(strSQL);
|
|
|
|
|
Missing single quotes around %s...
Very bad practice here, vulnerable to sql injection attack. Just type x;delete * from Table6 into m_cedit and you're toast.
|
|
|
|
|
<br />
CREATE TABLE TestTable<br />
(Field1 INT)<br />
GO<br />
<br />
DECLARE @Err INT<br />
<br />
INSERT INTO TestTable (field1) VALUES (9999999999)<br />
SELECT @Err = @@Error<br />
IF @Err <> 0<br />
BEGIN<br />
PRINT 'Im In'<br />
INSERT INTO TestTable (field1) VALUES ('1235456')<br />
END<br />
<br />
SELECT * FROM TestTable WHERE field1 = 'ABC'<br />
SELECT @Err = @@Error<br />
IF @Err <> 0<br />
BEGIN<br />
PRINT 'Im In'<br />
INSERT INTO TestTable (field1) VALUES ('1235456')<br />
END<br />
When executing the above code, you will enter the first @Err condition but not the second. Both errors produce the same Severity level so I'm not sure why it resumes on one but not the other. Is there any way to force an SP to resume next?
-Kay
|
|
|
|