|
Hi Mike,
Thanks very much for your reply. So the compacting is a default option which already be turned on in MSDE? How about SQL Server, the option is also turned on by default?
Is there any way I can configure this option so that it can be performed when there is 10% free space?
Many thanks for your help!!
|
|
|
|
|
I have a problem in restoring sql server database in asp.net
I have first written code for full backup and differential backup of database, it is working properly.
For full backup code is :
-----------------
-----------------
objBackUp.Action = SQLDMO.SQLDMO_BACKUP_TYPE.SQLDMOBackup_Database
objBackUp.Database = "tempbakup"
objBackUp.Devices = ""
objBackUp.Files = Server.MapPath("tempbakupFull.zip")
objBackUp.MediaName = Server.MapPath("tempbakupFull.zip")
objBackUp.MediaDescription = "TempBakup Database Backup Full" & Now
-------------------
------------------
For Differential backup :
objBackUp.Action = SQLDMO.SQLDMO_BACKUP_TYPE.SQLDMOBackup_Differential
objBackUp.Database = "tempbakup"
objBackUp.Devices = ""
objBackUp.Files = Server.MapPath("tempbakupDiff.zip")
objBackUp.MediaName = Server.MapPath("tempbakupDiff.zip")
objBackUp.MediaDescription = "TempBakup Database Backup Differential" & Now
But when I used wrote following code for restore databse, I got problem
"The volume on device 'c:\inetpub\wwwroot\TestApp\tempbakupfull.zip' is not part of a multiple family media set. BACKUP WITH FORMAT can be used to form a new media set."
CODE is
oRestore.Action = SQLDMO.SQLDMO_RESTORE_TYPE.SQLDMORestore_Database
oRestore.Database = "TempBakUp"
oRestore.Files = Server.MapPath("tempbakupfull.zip,tempbakupdiff.zip")
oRestore.FileNumber = 1
oRestore.ReplaceDatabase = True
oRestore.LastRestore = False
oRestore.SQLRestore(srv)
oRestore.FileNumber = 2
oRestore.LastRestore = true
oRestore.SQLRestore(srv)
|
|
|
|
|
hi all,
i want to select all the jobcode from jobmaster
my query is
SELECT txtjcode,convert(smalldatetime,dtlastdate)as last ,getdate()as tday FROM jobmast
it will work fine
it select entries like
test 2006-01-25 00:00:00 2006-02-01 09:51:05.107
US001 2006-01-25 00:00:00 2006-02-01 09:51:05.107
US002 2006-02-10 00:00:00 2006-02-01 09:51:05.107
but when use the following querry,
SELECT txtjcode,convert(smalldatetime,dtlastdate)as last ,getdate()as tday FROM jobmast WHERE convert(smalldatetime,dtlastdate)>= getdate()
it will select only this data
US002 2006-02-10 00:00:00 2006-02-01 09:51:05.107
and didnt select
US001 2006-01-25 00:00:00 2006-02-01 09:51:05.107
actually my query select both
why happens this so?
any soln to this
"i want to select all data where last date >= today date"
plz help urgent
CrazySanker
All I ever wanted is what others have....
|
|
|
|
|
One solution is that u should only save DATE portion in the datetime field u can send it as
Format(dtPicker.Value,"mm-dd-yyyy")
then ur query will work fine.
Regards,
Javed
|
|
|
|
|
What type is dtlastdate and why are you converting it? Shouldn't it already be in a datatime (or smalldatetime) format already?
crazysanker wrote: WHERE convert(smalldatetime,dtlastdate)>= getdate()
It didn't select the row with dtlastdate as 2006-01-25 because that is before now. You asked to select rows with a dtlastdate after now.
>= Greater than or equal to: WHERE dtlastdate is greater than or equal to getdate()
The query is working correctly.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
I know you can view the diagram icon, highlight it and click Cut or Copy, but if I go to another database with the same exact schema, how do I "paste" that diagram?
Thanks!
|
|
|
|
|
Here's how:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q320125
|
|
|
|
|
I am new in database, somebody has sent me a small database via mail its a file, how can i generate a database using it.
i just know that i need to create a database through Enterprize Manager but how to fill it using some file
please guide me step by step
|
|
|
|
|
It depends on what they've sent. If it is a backup file then just restore it. If it is an actual detached database then just attach it.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
|
In Enterprise Manager right-click the server, All Tasks, Attach Database... (or somesuch menu option - I don't have EM up right now so I can't check)
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
date acessing pblm
SELECT txtjcode,dtlastdate,getdate() FROM jobmast
it will select
test 2006-01-25 00:00:00 2006-01-25 11:00:35.903
US001 2006-02-01 00:00:00 2006-01-25 11:00:35.903
when i query
SELECT txtjcode,dtlastdate,getdate() FROM jobmast WHERE intstatus=1 and dtlastdate <= getdate()
US001 2006-02-01 00:00:00 2006-01-25 11:00:35.903
that do not select txtjcode "test"
actually time difference is there. ineed to select all upto todays date independend of todays time
what i do
CrazySanker
All I ever wanted is what others have....
|
|
|
|
|
What is the value of intstatus for the test row? You don't select that, but you do filter on it.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
|
Hi.
I posted this on the C# forum, but probablly this is a better place.
I'm having a little trouble getting this thing to work.
I have two tables Houses and People
Every "Person" belongs to a House, but only one per house is the "OwnerOfHouse".
So I made a colum named "HouseOwner" in the "House" table, which has the PersonID. And every person has a "HouseID_FK" which tells them to which house they belog.
SO here is the thing. I'm working with ADO.NET 2.0, and using BindingSource. So I have a BindingSource that has my Houses in a nice DataGridView, and when I click on any of them, I have another DataGridView which displays the people that live there.
That works Fine.
Now, when I chose one of the inhabitants, and press a button, His ID is updated on the Houses table, and I have a reference that tells me he is the Owner. So far so good.
What I want to do is that when I choose a House in my first DataGridView, The Owner is selected automaticlly in the People DataGridView. So far I've tried everything I could thinf of, but it allways selects the first element (the first person on the list).
Thanks in advance.
|
|
|
|
|
** HELP **
When one wants to version control their stored procedures, they can do this fairly easily through the VS.NET IDE.
As an FYI - If you care - Here is an old sample of how to do this
http://weblogs.asp.net/fmarguerie/archive/2003/02/24/2880.aspx
OK, all is good, now, if one MOVES the VSS database (in this case, to a different server), everything seems to go haywire.
(Using VS .NET 2003, SourceSafe version 6.0d, SQL Server 2000)
The problem seems to be rooted in the fact that there is no place to tell .NET IDE the new location of your srcsafe.ini file!
The FIRST time around, (after some preliminary tasks), in server explorer window, you simply right-click on the "+-Stored Procedures" entry and select "Add To Source Control". A nice dialog comes up and you enter the location of your SS database, and your project name, etc.
All SP's are added to VSS and bam! you are good to go.
When you go here to check in and out, refresh, you are asked for a SourceSafe login, etc.
Now, the VSS database has moved. So, when you try to log in to VSS it fails (just keeps popping up the login dialog until you click cancel). When you right click, Add and Remove from source control are disabled.
I have tried clearing out the database, unchecking and re-checking "Enable Version Control"
in Tools->Options->Database Tools->Server Explorer... nothing works!
Somewhere, the OLD location of this VSS database is being stored and I need to change it.
Any Help?????
Thanks,
-Len Miller
"If I had eight hours to chop down a tree, I'd spend six sharpening my axe."
-Abraham Lincoln
|
|
|
|
|
|
Thanks for the reply "S".
I did search the registry (I looked for srcsafe.ini & part of my VSS db path) nothing found except sone history entries.
The article & tool link you provided is cool, but it will not help. It only removes VSS references from a particular VS solution. The Server Explorer is independent of any solution. I do not have a particular solution that is at issue, it is when I navigate to "Stored Procedures" under my server explorer window.
Thanks again.
Thanks,
-Len Miller
"If I had eight hours to chop down a tree, I'd spend six sharpening my axe."
-Abraham Lincoln
|
|
|
|
|
Hello,
I'm trying to run this code in SQL Server 2005:
DECLARE @UserId int
EXEC User_Insert @UserId = @UserId OUTPUT, @FirstName = N'Luis Alonso', @LastName = N'Ramos',
@PhoneNumber = N'whatever, @Email = whatever', @UserName = N'luisr',
@UserType = 5, @BranchId = NULL, @CreationUserId = 0, @CreationDate = N'31/01/2006'
EXEC User_SetPassword @UserId = @UserId, @PasswordHash = N'356A192B7913B04C54574D18C28D46E6395428AB' and I'm getting this error:
Msg 8114, Level 16, State 1, Procedure User_Insert, Line 0<br />
Error converting data type nvarchar to datetime.
The problem is with the last parameter, CreationDate . I don't know how to pass a literal date value (it works fine when called from code using parameterized queries.) If I use SQL Management Studio to generate the query for me, it's generated as above, and it won't work.
Even using @CreationDate = GETDATE() won't work, but with a different error.
Ideas?
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
-- modified at 13:37 Tuesday 31st January, 2006
|
|
|
|
|
Try this.
<br />
DECLARE @UserId int<br />
DECLARE @dtNow DateTime<br />
Set @dtNow = GetDate()<br />
<br />
EXEC User_Insert @UserId = @UserId OUTPUT, @FirstName = N'Luis Alonso', @LastName = N'Ramos', @PhoneNumber = N'whatever, @Email = whatever', @UserName = N'luisr', @UserType = 5, @BranchId = NULL, @CreationUserId = 0, @CreationDate = @dtNow<br />
<br />
EXEC User_SetPassword @UserId = @UserId, @PasswordHash = N'356A192B7913B04C54574D18C28D46E6395428AB'<br />
Farhan Noor Qureshi
if (this == this) thow this;
|
|
|
|
|
Hi,
I have an c++application where the user enters the value of a"primary key" in a
Table via embedded sql. Is there a way of checking if the key already exists in the table. Thus I could show a message in the application to user that the value already exists. There for he would have to enter another one ?
Foxpro or mySql
Gerry
|
|
|
|
|
Hi,
1. How Can I transfer data stored on SQL 2000 with Operating System windows 2003 Advance Server to my PDA.
2. How can I get email with attachment (excel sheet)on my PDA.
|
|
|
|
|
Hi I am having trouble trying to figure out this sql query I need to display the opponents for a soccer team and display whether or not the team was at home or not at the moment I can display the two teams involved in the match and the stats I need but I don’t how to always get the other teams and display whether or not they were at home. This is my current query any help would be appreciated
Select homeClub.Name + ' v ' + awayClub.Name as Match, pz.DistanceCovered From Teams t
Join Person p on p.ID = t.PlayerID Join PZData pz on pz.TeamID = t.TeamID Join Match m on m.Id = t.MatchId
JOIN Squad homeSquad on m.SquadA = homeSquad.[ID]
JOIN Squad awaySquad on m.SquadB = awaySquad.[ID]
JOIN Club homeClub on homeSquad.ClubID = homeClub.[ID]
JOIN Club awayClub on awaySquad.ClubID = awayClub.[ID]
where t.ClubId in (select ClubID from Squad Where ID = 5)
and p.Id = 19
order by m.date asc
|
|
|
|
|
The only way you could get help with your problem is to list the following info:
1) A sample layout of a query result desired.
2) A list of the columns available in each of the tables.
Without this information we would only be guessing.
|
|
|
|
|
How to use session varibale using ASP?m Trying to create Secure webpages.But when user clicks on File->Send_>pgae as Email Attahcment,then pages go through but seession will not expir pls help me
regards
sumit
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
|
|
|
|