Get the date from SQL Server
-
I am currently moving a powerbuilder application from a SQL server 2000 environment to SQL 2005. Easy you would think until I discovered the code was full of this sort of thing select getdate() from sysobjects where id=1 simply to get the current date / time!! In SQL 2005 sysobjects does exist as a compatibility view however the data in it does not contain a record with an id of 1... the application fails in a big way..
Alex Baker
-
I am currently moving a powerbuilder application from a SQL server 2000 environment to SQL 2005. Easy you would think until I discovered the code was full of this sort of thing select getdate() from sysobjects where id=1 simply to get the current date / time!! In SQL 2005 sysobjects does exist as a compatibility view however the data in it does not contain a record with an id of 1... the application fails in a big way..
Alex Baker
nasty! did the original programmer not realise that
select getdate()
would work too?"An eye for an eye only ends up making the whole world blind"
-
I am currently moving a powerbuilder application from a SQL server 2000 environment to SQL 2005. Easy you would think until I discovered the code was full of this sort of thing select getdate() from sysobjects where id=1 simply to get the current date / time!! In SQL 2005 sysobjects does exist as a compatibility view however the data in it does not contain a record with an id of 1... the application fails in a big way..
Alex Baker
Looks kinda Oracle-ish -- it could be Oracle ported to SQL Server... badly. I worked for a company that had always used Oracle (on OpenVMS), but one customer wanted SQL Server (6) (on WinNT) so a bunch of PowerBuilder idiots were brought in to write some of the worst code I've ever seen. Data access in the UI?! X|
-
I am currently moving a powerbuilder application from a SQL server 2000 environment to SQL 2005. Easy you would think until I discovered the code was full of this sort of thing select getdate() from sysobjects where id=1 simply to get the current date / time!! In SQL 2005 sysobjects does exist as a compatibility view however the data in it does not contain a record with an id of 1... the application fails in a big way..
Alex Baker
The wonderful thing about standards is that there are so many of them. If I recall, I create a variable (in vb.net) with the name of the SQL get-date function, and then I use that. I forget how I set it, but it was something pretty clunky like "If database type looks like SQL Server, set it to GETDATE() otherwise set to NOW()".
-
The wonderful thing about standards is that there are so many of them. If I recall, I create a variable (in vb.net) with the name of the SQL get-date function, and then I use that. I forget how I set it, but it was something pretty clunky like "If database type looks like SQL Server, set it to GETDATE() otherwise set to NOW()".
-
I am currently moving a powerbuilder application from a SQL server 2000 environment to SQL 2005. Easy you would think until I discovered the code was full of this sort of thing select getdate() from sysobjects where id=1 simply to get the current date / time!! In SQL 2005 sysobjects does exist as a compatibility view however the data in it does not contain a record with an id of 1... the application fails in a big way..
Alex Baker
-
Hello, How to get miliseconds form MS SQL Server using ADO and C++ ? COleDateTime doesn't support miliseconds ... Best Regards, Irek
-
I am currently moving a powerbuilder application from a SQL server 2000 environment to SQL 2005. Easy you would think until I discovered the code was full of this sort of thing select getdate() from sysobjects where id=1 simply to get the current date / time!! In SQL 2005 sysobjects does exist as a compatibility view however the data in it does not contain a record with an id of 1... the application fails in a big way..
Alex Baker
If I remember right, I think Oracle programmers had to do something like
SELECT "Hello World" FROM DUAL
because it wouldn't allow a SELECT without a FROM. Could be a recent convert. -
If I remember right, I think Oracle programmers had to do something like
SELECT "Hello World" FROM DUAL
because it wouldn't allow a SELECT without a FROM. Could be a recent convert.You do remember right, and I was trying to forget.