background preloader

Software

Facebook Twitter

SQLDriverConnect. The Microsoft® SQL Server™ ODBC driver and the ODBC driver manager recognize the following SQLDriverConnect connection string keywords. Note Regional conversion settings apply to currency, numeric, date, and time data types. The conversion setting is only applicable to output conversion and is only visible when currency, numeric, date, or time values are converted to character strings. The driver uses the locale registry settings for the current user.

The driver does not honor the current thread's locale if the application sets it after connection by, for example, calling SetThreadLocale. Altering the regional behavior of a data source can cause application failure. An application that parses date strings, and expects date strings to appear as defined by ODBC, could be adversely affected by altering this value. SQLDriverConnect must be given a valid WindowHandle when any DriverCompletion value requires (or could require) the display of the driver's connection dialog box. Examples See Also. Run The Same SQL Command Against All SQL Server Databases. I need to loop the following script through all databases. I have tried almost everything I have researched online without any success. Any suggestions? DECLARE @table_name VARCHAR(500) DECLARE @schema_name VARCHAR(500) DECLARE @tab1 TABLE( tablename VARCHAR (500) collate database_default ,schemaname VARCHAR(500) collate database_default CREATE TABLE #temp_Table ( [tablename] [sysname] NOT NULL, [row_count] [int] NULL, [reserved] [varchar](50) NULL, [data] [varchar](50) NULL, [index_size] [varchar](50) NULL, [unused] [varchar](50) NULL) INSERT INTO @tab1 SELECT Table_Name, Table_Schema FROM information_schema.tables DECLARE c1 CURSOR FOR SELECT Table_Schema + '.' + Table_Name FROM information_schema.tables t1 OPEN c1 FETCH NEXT FROM c1 INTO @table_name SET @table_name = REPLACE(@table_name, '[',''); SET @table_name = REPLACE(@table_name, ']',''); -- make sure the object exists before calling sp_spacedused IF EXISTS(SELECT id FROM sysobjects WHERE id = OBJECT_ID(@table_name)) CLOSE c1 DEALLOCATE c1 SELECT t1.

Excel Best Practices. Efficient Excel Spreadsheet Designs in Spreadsheets. Questions? Excel Help See Also: speed up vba code & Slow Macros & Excel/VBA Golden Rules & Excel Services Best Practices | Consider The Code-VBA Add-in To Ensure your code is efficient Code Intro Excel is without doubt a very powerful spreadsheet application and arguably the best in the world. However, many people often design their spreadsheets with no foresight at all. This means most spreadsheets have poor foundations and have limited life spans. Perhaps the number one rule when designing a spreadsheet is, we should start with the end in mind and never assume you will not need to add more data or formulae to your spreadsheet, because, the chances are that you will. Excel Best Practice & Design On this page Rows [top] The very 1st thing you SHOULD know about Excel is that ALL versions contain far more rows than the Application can ever hope to handle.

Even with newer versions, the expectations far exceed the Applications capabilities. Spreadsheet Formatting [top] Find the last used Row. Excel Ranges: Finding the Last Cell in a Range. Back to: Excel VBA . Got any Excel/VBA Questions? Excel Help | Find & Return The Last Used Cell On An Excel Worksheet Or Column VBA Function Find the last used cell, before a blank in a Column: Sub LastCellBeforeBlankInColumn() Range("A1").End(xldown).Select End Sub Find the very last used cell in a Column: Sub LastCellInColumn() Range("A65536").End(xlup).Select End Sub Find the last cell, before a blank in a Row: Sub LastCellBeforeBlankInRow() Range("A1").End(xlToRight).Select End Sub Find the very last used cell in a Row: Sub LastCellInRow() Range("IV1").End(xlToLeft).Select End Sub Find the very last used cell on a Worksheet: Sub Demo() Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious).Select End Sub Find the last Row, Column or Cell You can use Edit>Go to-Special-Last cell to try and find the last cell in the active sheet, but it is not very reliable.

The reasons are two-fold: 1. 2. So when using VBA you cannot rely on: Range("A1").SpecialCells(xlCellTypeLastCell).Select.