Viewing 15 posts - 1 through 15 (of 5,355 total)
This line is in your script:
SET @cmd = 'ALTER INDEX ['+@IndexName+'] ON [dbo].'+@TableName+'] REBUILD
Fill that with life:
DECLARE @cmd varchar(200), @indexname varchar(200), @tablename varchar(200)
SELECT @indexname = '', @tablename = ''
SET @cmd...
June 12, 2009 at 5:48 am
Oops, apparently you would want to repleace #t with a permanent table in the AdventureWorks database. 🙂
June 12, 2009 at 4:58 am
Maybe something like this will work:
CREATE TABLE #t (c1 int);
DECLARE @i int;
SET @i = 1;
WHILE @i <= 10 --adjust this
BEGIN
INSERT INTO #t SELECT @i;
UPDATE #t SET c1 = @i;
DELETE #t...
June 12, 2009 at 4:57 am
Then why not run INSERT and DELETE statement in a loop?
June 12, 2009 at 4:49 am
A good way to check the correctness of a SQL string before executing it, is top PRINT it. You will notice that you are missing an opening bracket before @TableName
SET...
June 12, 2009 at 4:45 am
SELECT DATEADD (DAY, DATEDIFF (DAY, 0, '2009-05-28 11:18:49.123'), 0)
May 28, 2009 at 3:23 am
Sorry, if I was a bit lazy in my reply 🙂
I still keep forgetting about it, but another alternative in SQL Server 2005 might look something like this:
DECLARE @Output TABLE...
May 28, 2009 at 12:10 am
Have a look at the EXISTS () clause in Books Online. You can test if at least 1 row matches the criteria and if so do the UPDATE along with...
May 27, 2009 at 2:57 pm
GilaMonster (5/26/2009)
The requirement for being first normal forum is that there are no repeating groups. If we take the addresses as repeating groups, then this isn't...
May 26, 2009 at 1:21 pm
It is First Normal Form and normally you would want to have your model in Third Normal Form or even higher.
If you need some good arguments for the design discussion...
May 26, 2009 at 8:29 am
The only thing I can think of right now is that the "Script for server version" option is "SQL Server 2000". In that case the INCLUDE clause is ignored
May 26, 2009 at 5:47 am
A way to mimic this Access behaviour would be to right-click on the stored procedure in SSMS -> Execute -> and then supply the values in the window that opens...
December 31, 2008 at 3:47 am
nazaninahmady_sh (12/31/2008)
for example iwant to write "exec Garhasbi...
December 31, 2008 at 3:45 am
Viewing 15 posts - 1 through 15 (of 5,355 total)