Viewing 15 posts - 6,031 through 6,045 (of 13,469 total)
it depends on WHICH DMV also;
sys.dm_exec_connections are only valid while the spid is connected, i think;
sys.dm_db_index_usage_stats is good until a stop start,
but i think sys.dm_exec_query_plan would get cleared...
January 24, 2012 at 1:49 pm
i'm guess it's more complicated than the original post's simple REPLACE function
...for example if he's trying to replace stored procedure text, but there's code that does something like ISNULL(Category,'--');
he cannot...
January 24, 2012 at 1:45 pm
well, SQL server has no problem returning negative numbers...maybe it's a command line limitation?
CREATE PROCEDURE checkstate @param int
AS
return @param;
GO
DECLARE @return_status int;
EXEC @return_status = checkstate -1;
SELECT 'Return Status' = @return_status;
GO
January 24, 2012 at 10:30 am
all the databases can be selected from master.sys.databases;
SELECT * FROM master.sys.databases
WHERE database_id > 4 --skip master/tempdb/model/msdb
i would probably generate my list of commands from that same sql, and execute the...
January 24, 2012 at 6:22 am
i think you can do it inline with a sub select, like this without using an If structure:
CREATE Procedure [dbo].[sp_GGA_Testing]
@status int,
@ID int
As
SELECT ISNULL(ExistsVal,0)
FROM
(select 1 AS ExistsVal
from tblONE
where ID...
January 23, 2012 at 12:03 pm
if you use the optional WITH ROLLBACK IMMEDIATE, it will disconnect everyone from the database.
ALTER DATABASE Logging_demoSP2 SET SINGLE_USER WITH ROLLBACK IMMEDIATE
--do some exclusive stuff, like RESTORE
--if the database as...
January 23, 2012 at 11:11 am
Random Visitor (1/23/2012)
January 23, 2012 at 9:25 am
how you need to report or aggregate the information may play a factor; also whether they ever reference each others data.
the data is really independent of each other, right? there's...
January 23, 2012 at 8:18 am
Thanks Mark, but i think that won't quote work;
in the full table, i have more paths than just the "Program Files\Microsoft SQL Server" path example, many other paths might have...
January 23, 2012 at 6:58 am
ahh didn't know you were in SQL 2000; didn't read the forum.
max has no practical limit, but is SQL2005 and above, sorry.
maxsize in SQL2000 is NVARCHAR(4000) for an NVARCHAR; and...
January 20, 2012 at 2:02 pm
do you need the results on a per table command?
i've done something similar by building the string and executing it:
DECLARE @mycommand1 nvarchar(max);
SET @mycommand1=''
SELECT @mycommand1 = @mycommand1
+ N'DBCC...
January 20, 2012 at 1:13 pm
durai nagarajan (1/20/2012)
This DB was not built by me. SQL 2005 DB.
Basics Employee code, name and certain things are encrypted in this DB.
None of the table has primary key,...
January 20, 2012 at 11:08 am
Ninja's_RGR'us (1/20/2012)
Ehh, why not sum(case) ???
duh...err...no excuse. that's the right solution.
not thinking straight.
January 20, 2012 at 11:00 am
we'd really need to see the DDL of the table that the data gets extracted from to offer more than a suggestion or prototype.
I'd create a view instead that joins...
January 20, 2012 at 10:19 am
well i couldn't figure out what order you wanted via your example;
lets switch to real code so we can figure it out better.
does this do what you want? what's wrong...
January 20, 2012 at 9:58 am
Viewing 15 posts - 6,031 through 6,045 (of 13,469 total)