Viewing 15 posts - 1,741 through 1,755 (of 3,544 total)
Just semantics but how can yesterday be from last month ![]()
Two possible interpretations I can see from your request
1.
DECLARE @today datetime, @yesterday datetime
SET...
Far away is close at hand in the images of elsewhere.
Anon.
October 17, 2006 at 6:40 am
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)
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
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.
Far away is close at hand in the images of elsewhere.
Anon.
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)) + ''')'
Far away is close at hand in the images of elsewhere.
Anon.
October 13, 2006 at 7:23 am
Does your table name contain spaces?
Far away is close at hand in the images of elsewhere.
Anon.
October 13, 2006 at 7:12 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
Far away is close at hand in the images of elsewhere.
Anon.
October 13, 2006 at 6:59 am
| David stole my thunder |
![]()
Far away is close at hand in the images of elsewhere.
Anon.
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]...
Far away is close at hand in the images of elsewhere.
Anon.
October 12, 2006 at 7:27 am
| You cannot use #temp in dynamic SQL |
Yes you can ![]()
Provided it is...
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
October 12, 2006 at 6:36 am
| ...the Deleted table is empty for Deletes... |
Oh not it's not ![]()
Far away is close at hand in the images of elsewhere.
Anon.
October 10, 2006 at 6:51 am
| ...CASE Count(*) WHEN 0 THEN 0 ELSE 1 END AS CountStore... |
Or
SIGN(COUNT(*)) AS [CountStore] ![]()
Far away is close at hand in the images of elsewhere.
Anon.
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
Far away is close at hand in the images of elsewhere.
Anon.
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...
Far away is close at hand in the images of elsewhere.
Anon.
October 4, 2006 at 6:28 am
Viewing 15 posts - 1,741 through 1,755 (of 3,544 total)