Viewing 15 posts - 1,741 through 1,755 (of 3,543 total)
1. Put a constraint on the table to produce error for duplicates
2. Change the INSERT statement to only insert rows not already present
(use LEFT OUTER JOIN)
October 17, 2006 at 6:27 am
Use @@ROWCOUNT, something like this
SET ROWCOUNT 100
DECLARE @rowcount int
SET @rowcount = 1
WHILE @rowcount > 0
BEGIN
UPDATE test_bulk_update
SET updated = 'Y'
WHERE updated IS NULL...
October 16, 2006 at 9:12 am
Are you ignoring trapped errors?
e.g. no permission to table
If command fails, ExecuteScalar will return nothing and CInt will convert it to zero.
October 16, 2006 at 7:43 am
What are you trying to achieve
SELECT DATEADD(dd,1,GETDATE())
or
SELECT 'DATEADD(dd,1,'''+ CAST(GETDATE() as char(11)) + ''')'
October 13, 2006 at 7:23 am
http://support.microsoft.com/kb/q298674/
will give you your answer
Edit:
p.s. I always use fully-qualified column names in my subqueries
October 13, 2006 at 6:59 am
![]() | David stole my thunder ![]() |
October 12, 2006 at 7:42 am
Try this
DECLARE @LastName varchar(20)
DECLARE @FirstName varchar(20)
SET @LastName = 'Smith'
SET @FirstName = 'Jo'
CREATE TABLE #temp ([ID] int IDENTITY(1,1), Username varchar(40))
INSERT INTO #temp (UserName)
SELECT l.LastName+f.FirstName
FROM (SELECT n.Number,LEFT(@LastName,n.Number) AS [LastName]...
October 12, 2006 at 7:27 am
![]() | You cannot use #temp in dynamic SQL |
Yes you can
Provided it is...
October 12, 2006 at 6:54 am
Notwithstanding what has already been said
Top of the head answer
Create a permanent table consisting of SPID and Username
In SP
Insert @@SPID and Username into...
October 12, 2006 at 6:36 am
![]() | ...the Deleted table is empty for Deletes... |
Oh not it's not
October 10, 2006 at 6:51 am
![]() | ...CASE Count(*) WHEN 0 THEN 0 ELSE 1 END AS CountStore... |
Or
SIGN(COUNT(*)) AS [CountStore]
October 6, 2006 at 7:03 am
It is not a command it is a label for use with GOTO, eg
start:
PRINT 'Looping'
GOTO start
October 5, 2006 at 6:43 am
![]() | What is "transform data task" |
It is the task within a DTS package that transforms data between the Source...
October 4, 2006 at 6:28 am
![]() | ...the '00' unicode country code in these examples sticks out like a sore thumb... |
Thanks Jeff
October 4, 2006 at 1:49 am
Viewing 15 posts - 1,741 through 1,755 (of 3,543 total)