Viewing 15 posts - 166 through 180 (of 199 total)
Stefan,
Yep - only picked it up after the posting. I was right, it's a Friday thang....
Have a good weekend all
Steve
We need men who can dream of things that never were.
November 12, 2004 at 9:39 am
Double Oops,
I missed that as well, must be a Friday thang.....
Revised answer:-
ALTER TABLE [TableName] WITH NOCHECK ADD
CONSTRAINT [PK_tableName] PRIMARY KEY CLUSTERED
(
[ColumnName1],
[ColumnName2]
 
ON...
Steve
We need men who can dream of things that never were.
November 12, 2004 at 8:59 am
Hi Stefan,
Are you creating the table from scratch?
If so this should work just fine.
CREATE TABLE TableName ([PrimaryKey] [int] IDENTITY (1, 1) NOT NULL, [ColumnName] [int] NOT NULL,
[ColumnName] [varchar(4)] NOT...
Steve
We need men who can dream of things that never were.
November 12, 2004 at 8:32 am
Maybe i'm missing something......![]()
Does:
SELECT F1.F1_ID, F1.field1, F1.field2,F1.field3
FROM F1, T1
WHERE T1.Feild1 = F1.Feild1
AND T1.Feild2 = F1.Feild2
AND T1.Feild1 = 'Whatever it is you want'
Not cover what...
Steve
We need men who can dream of things that never were.
November 12, 2004 at 2:41 am
Farrel,
I hate to admit it but there was a minor error
in the last bit of code I posted for you.
sp_executesql requires that...
Steve
We need men who can dream of things that never were.
November 11, 2004 at 2:36 am
Farrel,
No worries mate.
Don't forget though: If you declare the variable within an sql string and exec it, it will generate a new spid and the variable will only have...
Steve
We need men who can dream of things that never were.
November 10, 2004 at 8:14 am
Farrel,
You may find this useful if you are going to push it further.
If you need to return values from dynamic sql within the same sproc a handy bit of...
Steve
We need men who can dream of things that never were.
November 10, 2004 at 7:28 am
Farrel,
Sorry - missed the bit about single quotes. Its easy to use this method:
DECLARE @Counter Int,
@Code varchar(250),
@SQL varchar(8000)
SELECT @Counter = 1
WHILE @Counter <= 6
BEGIN
SET @Code =...
Steve
We need men who can dream of things that never were.
November 10, 2004 at 3:44 am
Hi Again,
Sorry - only just got the e-mail. You are both actually right in different ways.
Farrel - You are getting the insertion of the variables into your sequel string wrong....
Steve
We need men who can dream of things that never were.
November 10, 2004 at 3:31 am
Hi,
I think you would have to actually post the code for the view Dimitrina.
Steve
We need men who can dream of things that never were.
November 9, 2004 at 7:35 am
Sadiq,
You need to use a trigger with this format:-
CREATE TRIGGER [Name] ON [Table]
AFTER UPDATE
AS
UPDATE [Table / Column]
INSERT INTO [Table] SELECT [* / Column] FROM Deleted d
Have fun
Steve
We need men who can dream of things that never were.
November 9, 2004 at 3:15 am
Is it just one table?
If not check this thread:-
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=145126
Have fun
Steve
We need men who can dream of things that never were.
November 9, 2004 at 2:32 am
Garry,
Just a thought. Can you not incorporate xp_cmdshell into the dynamic sql in the trigger?
Straight out of BOL:
This example writes...
Steve
We need men who can dream of things that never were.
November 8, 2004 at 8:48 am
No worries Garry,
Chop it up and use the bits that are relevant.
I'm always available at The Farmers when i'm not at work mate.
Best regards
Steve
We need men who can dream of things that never were.
November 8, 2004 at 8:39 am
Hi Garry,
Just remember this is still under development 😉
Stored procedure, pass it the name of the table you want the trigger on. Creates a table called audit_(your table name) on...
Steve
We need men who can dream of things that never were.
November 8, 2004 at 4:23 am
Viewing 15 posts - 166 through 180 (of 199 total)