Viewing 15 posts - 7,996 through 8,010 (of 13,469 total)
CREATE TABLE #temp (
NEWVALUE varchar(100),OLDVALUE varchar(100) )
Update MYTABLE
SET COLUMNA = COLUMNB
OUTPUT
INSERTED.COLUMNA,
DELETED.COLUMNA
INTO #temp(NEWVALUE,OLDVALUE)
where COLUMNA <> COLUMNB
SELECT * FROM #temp
drop...
March 4, 2011 at 2:47 pm
a foreign key can only be created on a a unique or primary key.
that unique constraint or primary key constraint can span multiple columns.
so if you changed your table to...
March 4, 2011 at 1:54 pm
the other option isusing locally declared variables. then the compiler cannot use parameter sniffing;
something like
CREATE PROCEDURE AVOIDSNIFFING(@Param1 int=0,@Param2 datetime = NULL)
AS
DECLARE @localParam1 int,
...
March 4, 2011 at 1:16 pm
i might consider doing it this way...
migrate all the data except the blob/images themselves, and then migrate the images 1000 at a time so i can see progress and have...
March 4, 2011 at 1:11 pm
you should be able to attach the mdl/ldf files as a new database name. I'm a little afraid that if the database was in use by SQL server, that the...
March 4, 2011 at 12:21 pm
nope; you'll have to grab a backup, restore it as a different db, and compare the two tables, migrating the good data to replace the unwanted changes;
SSMS uses implicit transactions,...
March 4, 2011 at 11:59 am
definitely my first instinct, the parameter sniffing issue, is what i would check first. what you are describing is a classic symptom.
does your stored procedure have default values for any...
March 4, 2011 at 11:24 am
it really depends on the application that is connecting;
For example, I have a dozen tabs open in SSMS to various databases;each tab shows up as a sessionID; they all...
March 4, 2011 at 9:54 am
SQLRandall did this idea work for you? I'm using a derivation of this technique to create a trace on the startup/restart of the server; i add a DML trace, and...
March 4, 2011 at 9:25 am
if we are going to help with syntax, you have to paste the entire script you are trying to use.
remember we are not standing in your cubicle looking over your...
March 4, 2011 at 8:38 am
what you would need is just a variation of the above example, but with the three foreign key columns involved; can you paste the definition of the primary key/unique constraint...
March 4, 2011 at 8:05 am
SKYBVI (3/4/2011)
Also, i want the results in body , not in as an attachment.Thanks.
Regards,
Sushant
please try both code snippets i pasted; one does exactly what you are asking by putting a...
March 4, 2011 at 7:50 am
the code i posted above has both examples: pasting the results of a SQL inline the html body, or as an attachment.
take a look at the lower example i pasted,...
March 4, 2011 at 7:29 am
my recommendation is to simply fix the trigger so you don't have to work around your errors; we can certainly help and offer advice and testable scripted solutions.
paste the trigger...
March 4, 2011 at 7:14 am
well it sounds like th trm_cde is a lookup value, correct?
so that table which contains all the possible trm_cde would have foreign keys from those 80 other tables, right?
one of...
March 4, 2011 at 7:11 am
Viewing 15 posts - 7,996 through 8,010 (of 13,469 total)