SQL

WorldShip SQL2005 sp_Tables

If you're reading this post then you are probably looking for a way to limit the number of table/view records returned by sp_tables. For some reason each time Worldship opens an import/export mapping it runs exec sp_tables NULL,NULL,NULL,N'''TABLE''' exec sp_tables NULL,NULL,NULL,N'''VIEW''' to return a list of tables. This includes sys and INFORMATION_SCHEMA tables that won't be used. Then the columns from each of the tables is returned. Overall this can add lots of processing time overhead to a ......

Nested output for sqlCommand.ExecuteXmlReader

I'm working on a task to get a sql rows as xml using sqlCommand.ExecuteXmlReader and transform them using XsltCompiled transform. The sqlCommand is calling a stored procedure that returns a select statement with FOR XML AUTO,ELEMENTS. The ExecuteXmlReader returns a XmlNodeList which can be fed to the XSLTCompiledTransform but does not produced the desired output. Here is an example from the AdventureWorks database select top 10 ProductID,[Name],[ProductNu... from [AdventureWorks].[Productio... ......

SQL Proc temp tables and TableAdapter

I'm not much of a web design guy but I have to do it once in a while. I needed to display some information on a web page that's in SQL. I like to call stored procs on the SQL server so it's easier for me to modify the logic if needed. Anyway the stored proc uses a bunch of temp tables and returns one of them. When I tried to use the tableadapter config wizard in VS2005 the wizard failed for the temp table. Apparently the wizard could not get the temp table metadata. To work around this put SET FMTONLY ......