You are currently browsing the MS SQL Server category

PowerBuilder – SQL Native Client Transaction Persistance

Posted on December 17, 2013 at 10:08 am in

There can be an issue with transactions not being disconnected from SQL Server when using the SQL Native Driver (SQLNCLIxx driver). In my case when the application was closed, the transactions were held open for up to four minutes. This may not be an issue with a small number of connections but with a large…

PowerBuilder – SQL Native Client Transaction Persistance - the full story »

Comment on PowerBuilder – SQL Native Client Transaction Persistance »

PowerBuilder ‘Gotcha’ – Column lists do not match

Posted on September 11, 2012 at 8:08 pm in

This is more of a database driver error but I encountered it within a datawindow I was working on so PB gets credit. I was working on a generic data drill down control which has a filtering process to eliminate data based on a date argument. Since I also wanted this date value for other…

PowerBuilder ‘Gotcha’ – Column lists do not match - the full story »

Comment on PowerBuilder ‘Gotcha’ – Column lists do not match »

Sending iCalendar events via a .Net Assembly and SQLServer stored procedure

Posted on July 31, 2012 at 5:01 pm in

As I’ve mentioned in earlier posts, the iCalendar format is a standard way to send event information to a variety of email/scheduling systems (Outlook, Google, etc.). Here is a way to set it up so that you can simply call a stored procedure to send the event. This assumes you have SQL Server set up…

Sending iCalendar events via a .Net Assembly and SQLServer stored procedure - the full story »

11 Comments on Sending iCalendar events via a .Net Assembly and SQLServer stored procedure »

PowerBuilder – SQL Native Client and DisableBind

Posted on March 19, 2012 at 5:51 pm in

Okay so you are upgrading your application, perhaps using the latest version of PowerBuilder (12.5) and SQL Server (2008 R2), and decide to use the SQL Native Client (SNC) to take advantage of new features in the database. Now like many organizations which use Microsoft SQL Server, you may have gone to OLE DB in…

PowerBuilder – SQL Native Client and DisableBind - the full story »

1 Comment on PowerBuilder – SQL Native Client and DisableBind »

Powerbuilder – Getting Database Identity Values after Multi Row Inserts from Datawindow

Posted on December 22, 2011 at 7:40 pm in

This is a technique to use when you have a data entry window in which multiple parent records can be inserted along with multiple child records for each parent and your tables have their record keys set up as identity values. The database in question for this discussion is SQL Server. This figure shows a…

Powerbuilder – Getting Database Identity Values after Multi Row Inserts from Datawindow - the full story »

2 Comments on Powerbuilder – Getting Database Identity Values after Multi Row Inserts from Datawindow »

SQL Server Identity Columns – Inserting and Resetting

Posted on September 27, 2011 at 8:20 pm in

So I wanted to test a scenario against a database table which had no rows, even though there were several currently in the table. Easy you say, just copy the data into a ‘backup’ table, delete the rows, run your tests, then copy the data back. Well not so fast when you have an IDENTITY…

SQL Server Identity Columns – Inserting and Resetting - the full story »

Comment on SQL Server Identity Columns – Inserting and Resetting »

Calculate the Last Day of the Month

Posted on September 16, 2011 at 8:20 pm in

Here is how to calculate the last day of the current month. Powerbuilder date ld_eom ld_eom = RelativeDate(Date(String(Month(Today()) + 1) + “/1/” + String(Year(Today()))), -1) SQL Server SELECT DATEADD(DAY, -1, DATEADD(MONTH, DATEDIFF(MONTH, 0, Getdate()) +1, 0)) I quess SQL Denali has a new function (EOMONTH) to do this too. SELECT EOMONTH(GETDATE())

Calculate the Last Day of the Month - the full story »

Comment on Calculate the Last Day of the Month »

Joining to a Table Function in SQL Server

Posted on September 9, 2011 at 8:20 pm in

Following up on my previous post, SQL Server (since version 2005 while in SQL 90 compatibility mode) provides the ability to join to the table created by a parameterized table function. In earlier versions you were not able to use a table function with a dynamic parameter or even join to it. If you needed…

Joining to a Table Function in SQL Server - the full story »

Comment on Joining to a Table Function in SQL Server »

Splitting up a String or Text in SQL

Posted on September 9, 2011 at 8:15 pm in

Here is a way to split up a block of text and return a result set based on a delimeter. A table function is used to do the ‘heavy lifting’ and, utilizing some newer features of SQL Server (2005 and 2008), you can even join to it providing for even greater flexability. This situation I…

Splitting up a String or Text in SQL - the full story »

1 Comment on Splitting up a String or Text in SQL »

Powerbuilder ‘Gotcha’ – SQLServer OLE DB and Identity columns

Posted on March 2, 2011 at 8:20 pm in

So I get a new machine at work and I’m busy loading all my development tools on it as well as changing settings and all such stuff. SQL Server and Powerbuilder get installed and upgraded, connected to Source Control, and I run the application from within the IDE. Things are fine until I insert a…

Powerbuilder ‘Gotcha’ – SQLServer OLE DB and Identity columns - the full story »

Comment on Powerbuilder ‘Gotcha’ – SQLServer OLE DB and Identity columns »

Top