Viewing 15 posts - 49,441 through 49,455 (of 49,571 total)
Yes, SQL's looking for a table-typed variable called @dbname1 to update, since an update statement must target a table, not a varchar variable.
More important is what are you trying to do?
If...
August 22, 2005 at 1:41 am
You missed my point. If you don't FETCH before going into the WHILE, you don't know the value of @@FETCH_STATUS since it is GLOBAL for ALL cursors on a connection....
August 19, 2005 at 12:19 am
Nononono The location of the fetches is correct. You left out a necessary BEGIN... END construct. That's why the execution didn't stop.
You must fetch before going into the loop or the...
August 18, 2005 at 3:59 am
Is you database in full recovery mode? If so, backup the log. That will truncate the log and allow you to shrink it.
If the database is in simple recovery mode,...
August 18, 2005 at 3:10 am
I can't believe I missed that....
August 17, 2005 at 11:48 pm
There's a few problems with this, other than the obvious that a cursor is in no way necessary here.
You're never using the value you get from the cursor. I'm not...
August 17, 2005 at 3:47 am
Remove (dbo.t_Attachments.AttachmentID) from the Group By clause. Since you want a count of it, you don't also want to group by it.
August 16, 2005 at 4:38 am
Dynamic sql is, in general, a very bad idea. It, amoung other things, leaves you very open to certain vulnerabilities, eg sql injection. See http://www.sommarskog.se/dynamic_sql.html for more detail
That said...
The error means...
July 26, 2005 at 5:24 am
Well 8114 is an error converting data type. My guess is that one of the fields that you're comparing with '' is of a type that empty string doesn't convert...
July 25, 2005 at 3:18 am
Hi Killer
You're more likely to get useful responses to this if you post it in the SQL Server administration forum.
This forum is just for discussion of the site's Question...
July 25, 2005 at 3:09 am
Do the not null columns have defaults defined on them?
July 21, 2005 at 2:03 am
I think you should get a dev/playground database where you can try stuff out before running on live.
July 18, 2005 at 6:22 am
Unless I'm misunderstanding...
Update tbl set B=A where B IS NULL
tbl Before
A | B |
---|---|
1 | a |
2 | NULL |
3 | NULL |
4 | d |
tbl After
A | B |
---|---|
1 | a |
2 | 2 |
3 | 3 |
4 | d |
July 18, 2005 at 5:07 am
Viewing 15 posts - 49,441 through 49,455 (of 49,571 total)