The following failed in EM (or whatever it is called now managementstudio I think) and I scripted it out and ran it in a query window toget more info. This works fine in SQL 2000 but not in 2005. I also triedto 'create' the database first then ran this command below but with the'force restore over existing database' checked on but this failed alsowhich is odd as well. Any ideas. This is my very first play with 2005 soit is not off to a great start although to be fair, i seem to have gorlucky on the install as it all went OK. BTW, is there a more approriatenewsgroup for this query?ThanksRESTORE DATABASE [bob] FROM DISK = N'C:BigFujiCopiesBob.bak' WITHFILE = 1,MOVE N'bob_Data' TO N'c:Program FilesMicrosoft SQLServerMSSQLDataob_Data.MDF',MOVE N'bob_Log' TO N'c:Program FilesMicrosoft SQLServerMSSQLDataob_Log.LDF',NOUNLOAD, STATS = 10GOMsg 5122, Level 16, State 1, Line 1Directory lookup for the file "c:Program FilesMicrosoft SQLServerMSSQLDataob_Data.MDF"failed with the operating system error 3(error not found).Msg 3156, Level 16, State 3, Line 1File 'bob_Data' cannot be restored to 'c:Program FilesMicrosoft SQLServerMSSQLDataob_Data.MDF'.Use WITH MOVE to identify a valid location for the file.Msg 5122, Level 16, State 1, Line 1Directory lookup for the file "c:Program FilesMicrosoft SQLServerMSSQLDataob_Log.LDF" failed with the operating system error3(error not found).Msg 3156, Level 16, State 3, Line 1File 'bob_Log' cannot be restored to 'c:Program FilesMicrosoft SQLServerMSSQLDataob_Log.LDF'. Use WITH MOVE to identify a validlocation for the file.Msg 3119, Level 16, State 1, Line 1Problems were identified while planning for the RESTORE statement.Previous messages provide details.Msg 3013, Level 16, State 1, Line 1RESTORE DATABASE is terminating abnormally.*** Sent via Developersdex http://www.developersdex.com ***
Using SQL Server 2008, we would like propose mirroring between two servers of a critical database. Since we initiate, may require to clarify on its purpose and also required changes from application end.Any changes required from OS Level? (I believe both servers IP or Host name should be added in host entries. Mirroring ports should be allowed/open including Principal and mirror server IP Addresses): Windows Team.Any changes required from Application? (Instance name, authentication: user name and its password should be added in web config files): Application Team.Any changes required from Network Team?Also for mirroring both the principal and mirror servers should be with same version, does it only mean SQL Server 2008 versions are enough or does it also mean to say build numbers 10.00.4000 should also be same.URL....
we are trying to build warehouse in our company its very small database but still. we have come to a point where we are able to pull reports from the database that we have created as OLTP which is truncated and reloading everyday . Now we have to stop doing that and just update the database and check for the changes in the existing data. Can anyone suggest ETL book/webcast/weblinks that could help me.
I am new to SQL Server. I tried to read as much as possible in newsgroups prior to this post. I have tried several different ways to install this without success. The last time I attempted to install as a local service and I unchecked hide advance configuration. I am running Windows XP SP2 with all the latest updates. Is there a solution to install this properly? Any help would be greatly appreciated!
I have sql server 2005 developer edition and vs2005 team system. I want's to use data cleansing feature.i.e. Integration Services Advanced Transforms Includes data mining, text mining, and data cleansing
Can please some body points me to any good webcast about using this feature
We see a lot of posts here related to data warehousing - it is clearly a hot topic with forum readers.
You may be interested to see that the Joy Mundy of the Kimball group is giving the following webcast :
Using SQL Server Integration Services to Populate a Kimball Method Data Warehouse featuring Joy Mundy July 11: 11:00 AM€“12:00 Noon PT
Anyone using SSIS in data warehousing will find this to be a most useful webcast - it was a hit at TechEd. I'm sure it will answer many questions and give great insights for forum readers.
Is there an easy way to find out what date was last friday to a given date? For example today is 20 Sep 2007, what would be the expression to find last friday to this date (14 Sep 2007) ?
Hi all...I'm still trying to figure out a query related to the topic I posted yesterday about the table scan...got past that...it was smoke and mirrors...
Now...I have a table that looks like (essentially) this: BegDate (smalldatetime) EndDate (smalldatetime) PortfolioID (int) WklyPerPriceChg (float)
I am trying to come up with a query that returns a table that looks like this: BegDate, EndDate, WklyPerPriceChg for PortfolioID1, WklyPerPriceChg for PortfolioID2, WklyPerPriceChg for PortfolioID3, WklyPerPriceChg for PortfolioID4
Here is my select:SELECT TOP 100 PERCENT T.BegDate as StartDate, T.EndDate as EndDate, SP.WklyPerPriceChg as Sandp, WR.WklyPerPriceChg as WeekRvw, NA.WklyPerPriceChg as NewAm, T.WklyPerPriceChg as T100 FROMdbo.WeeklyPortfolioIndex T (nolock) INNER JOIN dbo.WeeklyPortfolioIndex WR (nolock) ON T.BegDate = WR.BegDate INNER JOIN dbo.WeeklyPortfolioIndex NA (nolock) ON T.BegDate = NA.BegDate INNER JOIN dbo.WeeklyPortfolioIndex SP (nolock) ON T.BegDate = SP.BegDate WHERE((T.BegDate >= @FirstBegDate) AND (T.EndDate <= @LastEndDate)) AND SP.PortfolioID = 2 AND WR.PortfolioID = 67 AND NA.PortfolioID = 11 AND T.PortfolioID = 90 ORDER BY T.BegDate DESC
I think you can disregard the date stuff that seems to be working.
What I am finding though, is that the self-join only returns rows for dates that have ALL FOUR of the target portfolioID's. What I want is a row for any day that has AT LEAST ONE of the portfolios, and would like NULL or zero returned in the columns for any portfolioID that does NOT have a row present in the table for that date(range).
I thought I would try a FULL OUTER join rather than the inner one (which I would expect to return an output row if ALL portfolio rows were present for that day)...but that returns more of a cartesian product type thang rather than what I am looking for.
I further thought I need something like a GROUP BY T.BegDate, for example, but then it complains that my select columns are not aggregates.
I know this should be fairly easy...I'm just missing the boat by mere inches, I think...
And missing by "mere inches" is still enough to leave me all wet ;) Thoughts? Thanks!
If I put this in crystal reports I can manipulate it ok, but actually translating it to a command isn't so easy for me. I'm terrible at cursors and need some help here, pretty pretty please.
I have a table...
CREATE TABLE [dbo].[StagePayment] ( [PaymentID] [uniqueidentifier] NOT NULL , [JobID] [uniqueidentifier] NOT NULL , [Paid] [bit] NOT NULL , [Sequence] [smallint] NOT NULL , [Amount] [decimal](10, 2) NOT NULL , [Activity] [varchar] (30) NULL , [ActivityID] [uniqueidentifier] NULL , [DueDate] [datetime] NULL , [InvoiceNumber] [varchar] (50) NULL , [DueNext] [bit] NOT NULL ) ON [PRIMARY] GO
What I need to accomplish is flagging the DueNext field if the amount due has not been paid. I cannot rely on the Paid field as it's currently user controlled. I need to compare what's due with the total already paid (stored in another table).
So for instance, Job #68 - the total amount due would be $22902.00
If the customer has paid $15000.00 then Sequence 3, PayID 0C13, should be flagged as DueNext.
Anyone have a very simple example of a running total cursor that I can reference or a better idea of how to work with this? I appreciate any and all suggestions! Thanks! abbra_doo
I can't find a solution which works. According to one website, this should do it: DECLARE @Friday DATETIME SET @Friday = '20000107' SELECT DATEADD(day, ((DATEDIFF(day, @Friday, GETDATE()) / 7) * 7), @Friday)
Here is what I need to accomplishiif(len(sMemoText) > 15, left(sMemoText, 15) + '...', sMemoText)How to convert this into a case or anyother way to get this into aselect statement...Thanks MUCH!Jeff
I have just finished configuring my first test mirrored environment (High safety mode). I setup the database engine service accounts on each of the servers with domainuser. I inherited a production mirrored environment set up by someone else. On the production servers the database engine service account is NT Authorityuser a local account. I am trying to practice installing Windows updates within a mirrored environment and I not sure how to proceed when the service account is NT Authority user account. should I change the service account to a domainuser?
I have a query and am trying to just return the difference between two dates but not include weekends.For instance, if I have 08/21/2006 - 08/28/2006, there are 6 weekdays. I tried this, but I am getting 7 as a result.SELECT DATEDIFF(weekday, request_start_date, request_end_date) AS days_off, request_id FROM request Any help would be greatly appreciated.
ALTER DATABASE foo set PARTNER = 'TCP://10.3.3.1:1234' I get this error message:
The database is being closed before database mirroring is fully initialized. The ALTER DATABASE command failed. What does that mean, and how do I fix it?
When intalling SQL Server 2005 Express this gives me the message: SQL Server Setup could not connect to the database service for server configuration. The error was: {Microsoft}{ODBC Driver Manager} Data source name not found and no default driver specified Refer to server error logs and setup logs for more information. For details on how to view setup logs, see "How to View Setup Log Files" in SQL Server Books Online. Error No:29545 which I don't get since I have SQL Server 2000 Dev Edtion running, Win 2K sp4. I couldn't find anything in the MS KB to explain why it's doing so.. anything I missed perhaps?
Hello, I am trying to install SQL 2005 April CTP on a laptop running XP SP2. (Using the MSDN DVD Pack - VSTS etc). The pre-requisites get installed but then i get this error message below. The link it points to just says that there is no info available on that topic. Can someone help?
Here is the text I do not believe is correct or at the least misleading...
"If you want to terminate the external transaction from within your stored procedure or function. In this case, you call the Transaction.Current.Rollback method. "
You cannot terminate transactions declared in TSQL in SQLCLR routines.
I set up a new mirror server. Everything is good except that the Database Mirroring Monitor is not working for one of the databases. In the monitor the principal data is showing up as blank
If I look at dbm_monitor_data on the principal most of the data columns (e.g. Send_queue_size) are null where as they have data for the other databases.
Both servers are SQL Server 9.0.2047 Enterprise Edition.
I have read on the web that high protection mode not recommended, except in the event of replacing the existing witness server. But I can't find the reason why anywhere. Can anybody explain? Thanks.