Viewing 15 posts - 10,951 through 10,965 (of 13,469 total)
lakshminarasimhanv (6/20/2009)
Can you please tell me how to modify the script to delete records from master and check if any dependent child will be afftected....
June 20, 2009 at 9:04 am
that would be the easy part; since the temp table #Hierarchy has the tables in the right order, change the last SELECT statement to this:
SELECT
CASE WHEN FKLevel=0...
June 20, 2009 at 6:28 am
you must explicitly identify the column names, especial when identity_insert is on:
SET IDENTITY_INSERT MyTable ON
insert into MyTable(ColumnId,ColumnDate) values(3508,'06/07/2009')
zubamark (6/19/2009)
I tried to execute in SQL Server 2005 Query Analyzer the following...
June 19, 2009 at 10:34 am
something like this should get you started:
SELECT
@Category As TheSelectedCategory,
CASE
WHEN ILCategory IN (3,4) AND SCCategory =1
THEN...
June 19, 2009 at 10:06 am
here's a script that creates the delete/truncate commands for all tables in the correct foreign key hierarchy order....
the issue I've always found is that often you have lookup tables, like...
June 19, 2009 at 8:50 am
Ok - but the problem is, sometimes the parent_id could change from another system. That's where I'm getting lost here. I'm trying to avoid using the parent_id as an identity....
June 19, 2009 at 8:45 am
you wouldn't open a trace file directly with notepad.
here's what i do:
i create a view for any trace i create, so I can easily access it.
here's a code example:
--review all...
June 19, 2009 at 8:34 am
Dugi's got you on the right track. use ISNULL to put in a default value, or raise an error before it gets to the trigger in the first place.
as...
June 19, 2009 at 8:22 am
ps (6/19/2009)
Also wouldn't it be good to drop the database if you do not want tables to be there?
Question...
June 19, 2009 at 8:17 am
your'e trying to use an identity() column in the wrong way; an identity should simply identify one row as unique, and should never repeat...what you want is basically a ranking...
June 19, 2009 at 8:13 am
it can be done yes...but it's going to involve a bit of work. search for "FTP" on this site, and look at "Scripts" ; there s quite a few contributions...
June 19, 2009 at 7:55 am
GilaMonster (6/19/2009)
June 19, 2009 at 7:19 am
'ftp://username:password@xx.xx.xxx.xxx/domainname/www/textdocument.txt' is not a static filepath..., you have do download the file from your ftp site to a location on the server(or maybe in anetwork share if your account...
June 19, 2009 at 7:05 am
it might be that you need identify the columns to insert into:
INSERT INTO DatabaseReport.dbo.Database_File_Info(col1,col2...)
June 19, 2009 at 12:43 am
did i misread the question? i thought he wants audit triggers to write to a separate database,and didn't see where anything about a separate server.
I thought it would be a...
June 18, 2009 at 8:04 am
Viewing 15 posts - 10,951 through 10,965 (of 13,469 total)