Viewing 15 posts - 11,731 through 11,745 (of 13,469 total)
on;y SQL 20l08 has a table variabe as a parameter for an option.
in 2000 you'll need to do all the work in a single udf instead of 2 udfs.
January 22, 2009 at 9:13 pm
here's a cursor based solution that finds all char/varchar columns for a given table, then queries each for empty /nulls, aqnd provides the results, along with the query to find...
January 22, 2009 at 9:06 pm
33938 records....seems like an awful lot of zip codes cross counties.
here's a link to a tab delimited text file:
here's my source table that I used; i did a distinct from...
January 22, 2009 at 4:02 pm
i've got a massive zip+4 database; I just started essentially the same query, and will post a link to the file with the results; had to do it on my...
January 22, 2009 at 3:23 pm
it's just an update instead of an insert....but there has to be something to join the data...an ID column or some other criteria.
you should really ALWAYS post the real table...
January 21, 2009 at 9:36 pm
i'd simply insert from a UNION of the two alternate sources;
insert into Table1(alotofcolumns)
select alotofcolumns from Server1.Database.dbo.Source1Table WHERE criteria=1
union
select alotofcolumns from Server2.Database.dbo.Source2Table WHERE criteria=1
January 21, 2009 at 9:05 pm
you don't even need to check, really
you simply do two steps in the trigger
you update first, and if it exists, it gets updated. if it didn't exist, nothing gets touched.
then...
January 21, 2009 at 5:33 pm
a builtin function called PARSENAME can do this for you...irt was designed to parse dbname.owner.table.columnname, but works greate for IPs:
declare @val varchar(20)
set @val='192.168.1.100'
select parsename(@val,4),parsename(@val,3),parsename(@val,2),parsename(@val,1)
1921681100
January 21, 2009 at 5:27 pm
i really like the answers that point to a link with letmegooglethatforyou.com...i really think it makes people think twice.
so yeah, our answers might be a little arrogant when we do...
January 21, 2009 at 5:10 pm
i think you'll have to move the logic to an ON INSERT trigger, ;
this might be a little tricky, considering that a trigger needs to assume multiple rows might exist....
say...
January 21, 2009 at 5:03 pm
I agree with Barry; still waiting to hear why an Identity() column, or varchar based off of an identity, or a GUID won't do the job.
January 21, 2009 at 4:45 pm
for views,procedures,functions (and triggers) you could use a cursor to exec sp_helptext [objectname]
that would give you the script for those objects, assuming they were not marked WITH ENCRYPTION when they...
January 21, 2009 at 6:23 am
harish_ravi (1/20/2009)
if so please...
January 20, 2009 at 10:06 pm
the ISNULL function substitutes a value in place of the variable or column if it is null:
SELECT ISNULL(@Variable1,0.00) - ISNULL(@Variable2,0.00)
January 20, 2009 at 9:21 pm
two things to consider....
if you are going to delete the records after archiving them off to another table, consider doing it in batches....if you do too many rows at a...
January 20, 2009 at 9:18 pm
Viewing 15 posts - 11,731 through 11,745 (of 13,469 total)