|
The answer was;
WHERE [TimeStamp]>= Convert(varchar(10), DateADD(DAY, -1, GETDATE()), 101) AND [TimeStamp] < Convert(varchar(10), GETDATE(), 101)
This gave the info for the previous day only.
Brian
|
|
|
|
|
Hi all,
I have the following script to do a back up of SQL2005 database:
BACKUP DATABASE [Repo] TO DISK = N'C:\Program Files\repo.dat' WITH NOFORMAT, NOINIT, NAME = N'repor-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
When i try to look for Repo.dat file under C:\programfiles i cant get it.
Please advice
Thanks
|
|
|
|
|
SQL Server would save it to the filesystem on the machine in which SQL Server is running, not on the client box from where you issue the backup command.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
hi
My aim is to retrieve a picture from a access database ................
This is the code which i am using
byte[] bt = (byte[])(bindreader[0]);
MemoryStream mst = new MemoryStream();
mst.Write(bt, 0, bt.Length);
pbox.BackgroundImage = Image.FromStream(mst);
its working fine when the image is stored through code it will be in long binary format
when i am inserting image thru access its in the bmp so its creating a problem if any one knows how to tackle this situation please help me .
regards
sindhu tiwari
always innovative
|
|
|
|
|
I am willing to take on datawarehousing course. what things to keep in mind for choosing a course from an institute or for choosing which institute to got for it.
I have worked upto reporting services and integration services in sql server 2005 and would like to go ahead with database side.
I am in mumbai (India) and if someone can suggest me out, it will be a great help.
Thanks.
Jwalant Natvarlal Soneji BE IT, India
|
|
|
|
|
I went on a course for Reporting Services last month. The trainer just went through the Reporting Services step-by-step book. I could have done that myself.
If you are paying for this yourself, I recommend that you buy the Step-by-Step book and then take a week off to study it.
|
|
|
|
|
hey everyone i am getting this error on sql server 2005:
" An error has occured while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server )"
could anybody help me out here?
Luis E Tineo S
|
|
|
|
|
set the remote connection...
|
|
|
|
|
You must enable remote connections for each instance of SQL Server 2005 that you want to connect to from a remote computer. To do this, follow these steps:
1. Click Start, point to Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Surface Area Configuration.
2. On the SQL Server 2005 Surface Area Configuration page, click Surface Area Configuration for Services and Connections.
3. On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Remote Connections, click Local and remote connections, click the appropriate protocol to enable for your environment, and then click Apply.
Note Click OK when you receive the following message:
Changes to Connection Settings will not take effect until you restart the Database Engine service.
4. On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Service, click Stop, wait until the MSSQLSERVER service stops, and then click Start to restart the MSSQLSERVER service.
|
|
|
|
|
hi there,
i m using sql server 2005, and i wanna know how can i change primary key data
for example :
i have 3 tables
1. have 3 columns(EmpID, Salary, RegID)
where EmpID is Primary key and RegID is unique Key
2. have 2 columns(EmpID, Work)
where EmpID is Foreign key
3. have 2 columns(EmpID, Status)
where EmpID is Foreign key
now i wanna change EmpID in all 3 tables,
so i try do it something like this, as i know it will give error and wont work
Update Table1 set EmpID = XX where RegID = XX
can someone tell how can i do this... mean if i change EmpID in table 1 then it automatically change EmpID in others tables
is it possible? or any other way?
thanks
Becoming Programmer...
|
|
|
|
|
Well, its a bit of a strange thing to do as primary keys aren't supposed to change and the foreign keys are there to maintain integrity between tables.
I think you'd need to drop your foreign key constraints, perform the update on the main table, then perform updates on table 2 and 3 so everything points to where it should and reintroduce your foreign keys.
Regards,
Rob Philpott.
|
|
|
|
|
If you specify ON UPDATE CASCADE option when creating the foreign keys, updates to Primary key will reflect in Foreign keys.
Check MSDN to know how to specify this option using T-SQL code or management studio.
|
|
|
|
|
thanks dude
Becoming Programmer...
|
|
|
|
|
Hi,
I have got a problem on a XP Pro development machine using SQL Server 2005, VS 2005. During my development and testing of a Web 2.0 app, I have sporadic times in executing the same query. A query will run within a second for a while and then will start taking 30 seconds to complete. I have tried restarting sql server with no effect. The only thing that fixes it is the restart the machine. It doesn't seem to be linked to a particular query. Has anyone else had this problem?
Thanks, Jared
|
|
|
|
|
Once the query starts taking a long time to return in the asp.net app, I have copy the query into management studio and ran it to check it has anything to do with asp.net and it still takes a long time to run.
|
|
|
|
|
I believe that this is probably due to not having enough memory on my machine. I have 1GB which is nearly all used with those hungry microsoft products. I will need to do some further testing to confirm this.
|
|
|
|
|
I am trying to run this query;
declare @StartDate DateTime
declare @EndDate DateTime
set @StartDate = cast('2007/10/22' as DateTime)
set @EndDate = cast('2007/11/05' as DateTime)
SELECT RT_MCP_Name, RT_MCP_State, RT_MCP_Alarm_Text, COUNT(RT_MCP_Alarm_Text) AS Error_Count, CONVERT(char(10), RT_MCP_Date_Time, 111) as ErrorDate, RT_MCP_Bit_State as BOOLEAN
FROM RT_MCP_Historic_Alarms
where RT_MCP_Date_Time >@StartDate and RT_MCP_Date_Time <dateadd(day, 1,@enddate)="" and="" rt_mcp_alarm_text="" <u="">RT_MCP_Bit_State <> FALSE
GROUP BY RT_MCP_Name, RT_MCP_State, RT_MCP_Alarm_Text, CONVERT(char(10), RT_MCP_Date_Time, 111)
ORDER BY RT_MCP_Date_Time, Error_Count DESC, RT_MCP_Name, RT_MCP_State, RT_MCP_Alarm_Text
I recieve this error when I try to run it. The BOLDED column is a BIT type, for a True/False choice. I do not need to know when the items go false, only when the meet the TRUE bit.
Thanks,
|
|
|
|
|
Use 0 and 1 to test a BIT value
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Figured this out after I wrote it.
The other problem I had was;
ORDER BY RT_MCP_Date_Time, Error_Count DESC, RT_MCP_Name, RT_MCP_State, RT_MCP_Alarm_Text
I declared the RT_MCP_Date_Time as ErrorDate in the select statement and didn't put it in the ORDER BY statement correctly.
Thanks for your help.
|
|
|
|
|
Hi, I'm new with the SQL language. I would like to ask for tips
or advice on what part of the SQL server to start?
I'll really appreciate the help.
Thanks.
|
|
|
|
|
meki_2118 wrote: I'm new with the SQL language. I would like to ask for tips
or advice on what part of the SQL server to start?
Download the Northwind or AdvertureWorks database from the Microsoft website (there will be instructions on how to add it to your SQL Server). You can then play with them in order to get to grips with the language.
I would also recommend the step-by-step books by Microsoft Press.
|
|
|
|
|
meki_2118 wrote: I would like to ask for tips
or advice
This site and forum are a good start
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Frenz,
I have created a cube using sql server analysis services and i have imported the cube in to excel using get external data and it has also been successfully imported as a pivot table. This uses windows authentication.
Now what I want exactly is.. all the users should not be able to slice and dice the data thru all dimensions..
For example :
If a Project Manager manages 3 or 4 projects.. in the projects field from the pivot table he should be able to slice and dice the data of those 3 or 4 projects and he should not be able to view the other data..
Is there any way that we can specify this access restriction at cube level itself in such a way that
it should take the userid of the project manager from the active directory thru an excel vba script and based on the data fetched from AD... Can it be passed to the cube to filter out only certain data and fields for the person logged in???
Kindly help @ the earliest
Thanks and Regards
Sathya Narayanan
s.sathyanarayanan@gmail.com
+919884450583
|
|
|
|
|
Multiple business partners of master need to use the details of all the sales stores stored in msdb database server.The details include the name of store,name of store owner,and email address of store owner.As per company's security policy,access to company's databases can't be provided to any external entity.
HOW WILL YOU MAKE THE LIST AVAILABLE TO OTHER ORGANISATIONS WITHOUT ANY ADDITIONAL OVERHEAD?
BALA
|
|
|
|
|
baala.m wrote: HOW WILL YOU MAKE THE LIST AVAILABLE TO OTHER ORGANISATIONS WITHOUT ANY ADDITIONAL OVERHEAD?
You can't. Any solution will require additional "overhead" in order to securely expose your data to the relevant parties.
Removing that constraint, then the most obvious solution would be to create a web service that gives them appropriate access.
|
|
|
|