Morning,
I know I am close BUT I still can't get this code snippette to return the date of last sunday (as in 1/9/2011 - format of date does not matter).
Here is what I have so far (borrowed from a web page):
DECLARE @LastSundayNight DateTime
SET @LastSundayNight = GetDate()
SELECT CASE...
I am trying to update a record set with the last restore date that is captured with a TOP clause in the code.
Here is the code (that does not work):
UPDATE MyTable
SET MyDate =
( SELECT TOP 1 RESTORE_DATE
FROM MSDB.dbo.RESTOREHISTORY WITH (nolock)
JOIN MyTable
ON...
OK .. brain dead for a Friday - lol
So I have a server where I am "trying" to call a remote stored proc to load a local table.
Somthing like ...
INSERT INTO Admin.dbo.MyTable (
Col1,
Col2 )
EXEC MyRemoteDB.dbo.MySP
Now Admin.dbo.MyTable is the local table and MyRemoteDB.dbo.MySP...
I have an instance of 08R2 running on my box with an instance of 05SP3.
Running the query in the 05 instance returns the result sets from the remote server just fine.
When I run it from the R2 instance it failes with the followig error:
OLE DB provider "SQLNCLI10" for linked server "(null)"...
I know I have toggled it on in the past but where do you set Mgt Studio to show you how your commands line up?
In other words, If I use an IF\ELSE statement I want to be able to highlight the IF and it shows me the corresponding ELSE further down in the code.
Thanks!
Thanks
J. Kusch
TableA has database name column and active\inactive flag
TableB has database name
When we inactivate database(s) in TableA we want code later on to insert the newly deactivated database(s) name(s) into TableB.
I know code with use an IF NOT EXIST on the TableB insertion code, just not able to...
I have a table (TableA) that needs to have a date field updated with a MAX(Date) from another table (TableC).
To add to this ... We need to join to a TableB to get an ID to have it hook up right.
So TableA looks like:
DBName varchar(100),
CreateDate DateTime
TableB looks like:
DBName...
Afternoon,
I need to figure out the syntax to create a stored procedure in every one of our database (all 1200+) which is part of a stored procedure execution logging process.
I have been trying to get MSForEachDB to work.
Any ideas on how to accomplish this task?
Thanks
Thanks
J. Kusch
Say I have a string of:
R:\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\model.mdf
and I want to know the position of the last \ (which would be position 43).
Thanks!
Thanks
J. Kusch
Morning,
Here is the scenario,
Currently have 150+ publications on an x32 SQL 2000 instance.
We plan to migrate to an x32 SQL 2005 instance on the same server.
That part we pretty much have worked out and tested.
The next hurdle is that we will then be migrating the x32 SQL 2005...
I am looking for a replacement to the VB script I had rolled into a SQL job that would manually script all of my SQL Server jobs to a file. It uses SQLDMO (I know many of you have seen this canned job out on the net).
Issue is SQL2008 is not wanting to play with SQLDMO any more (or at least on...
OK ... here are the OS and SQL server data points:
Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (X64) Jul 9 2008 14:17:44 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 5.2 <X64> (Build 3790: Service Pack 2)
XP_CmdShell HAS been enabled via a...
Can anyone point me to the most recent Best Practices on dealing with the data layer?
I am looking for doc/man/whitepaper that relays what is the best method for data access.
trying to find rules and such that say it is better to leverage stored procs, UDFs, UDDTs and such in the database that...
So how do I go about using an OPENROWSET command to set a variable based on a remote COUNT(*) of a table.
I know it does not look like this ... but here is what I am after:
declare @P Int,
@Pub VarChar(20),
@Pub_DB VarChar(20),
@Art VarChar(20)
SELECT @P = COUNT(*)...
OK ... my brain has given up for the day - lol.
I have 2 tables:
Tbl1 and Tbl2 both have Col1 VarChar(10), Col2 VarChar(10)
I need to find what records in Tbl1 do not exist in Table 2 based on BOTH Col1 AND Col2.
I tried a couple of variations like:
select *
from Tbl1
WHERE NOT EXISTS (...
I have a name instance of SS2K5 Reporting Services (x64).
Instance name is SS2K5_DBA.
Thus I have default web sites in IIS showing as Reports$SS2K5_DBA and ReportServer$SS2K5_DBA.
RS has been configured and is showing all is fine (all green
When I try to enter ...
I have installed reporting services and when I bring the RM up in my browser, it is very "plain". All it show is what I have pasted below:
localhost/ReportServer_SS2K5 - /
----------------------------------------------------------
Wednesday, July 09, 2008 9:44 AM <dir> Data Sources...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.