Viewing 15 posts - 16 through 30 (of 358 total)
The good thing about using sp_executesql is that you can pass the parameter value instead of completely building the string on the fly like this...
DECLARE @sql NVARCHAR(MAX)
DECLARE @TBL...
July 22, 2009 at 10:00 am
Try using sp_executesql and see if that fixes it.
Here is a sample that should work.
DECLARE @sql NVARCHAR(MAX)
DECLARE @TBL TABLE (i int)
SET @sql = 'SELECT TOP 10...
July 22, 2009 at 9:03 am
You need to remove the single quotes from the variable in your stored procedure.
Change this...
AND C.ContractStatus = 'A' AND S.UnitState = '@UnitState'
To this...
AND C.ContractStatus = 'A' AND S.UnitState = @UnitState
July 22, 2009 at 7:30 am
Pretty good bit of summary info. I like it. Just sent it out to the other DBAs at work.
You need to add it to the scripts section so I...
July 21, 2009 at 2:53 pm
Here is an article about index fragmentation
http://msdn.microsoft.com/en-us/library/ms189858(SQL.90).aspx
And here is the script that I am currently using to defrag/rebuild all indexes.
There are several others available as well.
July 21, 2009 at 12:55 pm
As long as you output restults to text, this should work.
sp_msforeachtable 'PRINT ''Table Name: ?''; EXEC sp_helpstats ''?'''
July 21, 2009 at 12:17 pm
All of the jobs are stored in the msdb system database. If you have a backup of that database on your old drive, you can restore it over your new...
July 21, 2009 at 7:17 am
The answer to both of your questions is yes. Indexes take up space. You can even create a seperate filegroup and move them if you want. With an Indexed...
July 14, 2009 at 1:53 pm
Kenneth Langner Jr. (7/1/2009)
If this is SQL Server 2005 Try this:USE [master]
GO
EXEC dbo.sp_dbcmptlevel @dbname=N'Database_Name', @new_cmptlevel=90
GO
That's right. I have been working with 2008 for too long. 🙂
July 1, 2009 at 7:41 am
The only thing that I can think of that would cause it may be a case sensativity issue. Try this and see if it works.
ALTER DATABASE [SGCT] SET COMPATIBILITY_LEVEL...
July 1, 2009 at 7:39 am
You can export the Maintenance Plan to a file and import it into another server. All you have to do then is open the Maintenance Plan Design Tab and...
July 1, 2009 at 7:34 am
Try something like this.
select a,b,c
from abc
where (
((len(@P1) > 0 and DocNo like @P1 + '%') or
(len(@P1) 0 and DocNo like @P1 + '%') or
(len(@P1)...
June 17, 2009 at 9:55 am
Here is some code that may help. I am using xp_cmdshell to create the file, so you may need to enable it first.
--Enable xp_cmdshell
EXEC master.dbo.sp_configure 'show advanced options', 1
RECONFIGURE
EXEC...
June 17, 2009 at 9:20 am
Like Steve said, this may be better suited for the .Net forums, but just like everything. It depends. I rarely use StringBuilder when I code. I only use it when...
June 13, 2009 at 10:00 pm
You could create a temp table to hold the variable and then use the value from the temp table.
Something like...
DECLARE @Tbl TABLE (NewKey varchar(100))
INSERT INTO @Tbl
EXEC SomeProc
SELECT NewKey FROM @Tbl
There...
June 11, 2009 at 2:25 pm
Viewing 15 posts - 16 through 30 (of 358 total)