WHERE s.name = t.name = c.name = IS NOT NULLĮXEC sys.sp_executesql int, nvarchar(4000)', 56725, N'Object not found for update. JOIN sys.columns c ON t.object_id = c.object_id JOIN sys.tables t ON s.schema_id = t.schema_id SELECT = N'UPDATE ' + QUOTENAME(s.name) + N'.' + QUOTENAME(t.name) + N' SET ' + QUOTENAME(c.name) + N' = WHERE id = sys.schemas s This results in some (awful abomination) like this: String sql = nvarchar(MAX) I've been using it for years and really happy with it. That being said, what you can do if pass parameters for the object names, the id and the value, and then create a dynamic SQL statement, checking against the system objects. What's the best free SQL client for Mac Looking for an alternative to phpMyAdmin or MySQL Workbench Featured 5yr ago 8 recommended 118 Sequel Pro Louis de Vaumas Automation specialist Edited 5yr ago Without any hesitation: Sequel Pro. ![]() I do, however, want to repeat that everything in the comments is still true just don't do this. I felt like writing something for this anyway, because I don't write a lot of C#.
0 Comments
Leave a Reply. |