Quantcast
Channel: Latest Questions by johnshaddad
Browsing all 16 articles
Browse latest View live

MySQL to MSSQL: IF(value=5,1,NULL) how to do it in MSSQL?

How can I convert this MySQL statement to MSSQL? IF(value=5,1,NULL) It is a simple IF statement that returns the first value if TRUE (1), and the second if FALSE (NULL) I am using this with PHP so it...

View Article



HOW TO SOLVE: Only functions and some extended stored procedures can be...

I have the following FUNCTION and PROCEDURE. When I call the function on a normal SELECT statement (ie. "SELECT dbo.CLIENT_DELETE('100');") it returns the following error: 'Only functions and some...

View Article

Sending SMTP mail in MSSQL 2008 R2 Express

I am trying to use this code to send SMTP mail in MSSQL 2008 R2 EXPRESS: [http://www.freevbcode.com/ShowCode.asp?ID=6699][1] But I am getting the following error: **Msg 15281, Level 16, State 1,...

View Article

PHP with MSSQL: strtotime() with MSSQL DATETIME column

So I have MSSQL datetime field, and in PHP I want to use this as a UNIX TIMESTAMP, because I want to use it with strtotime, in order to add 14 days into it. Eg. If it is stored in the MSSQL database...

View Article

Upgrading from SQL Server 2008 R2 Express to SQL Server 2008 R2 Enterprise

When I tried upgrading from SQL Server 2008 R2 Express to SQL Server 2008 R2 Enterprise, it passed all tests and then it failed at step "Select features", saying the following error: "There are no...

View Article


How to execute procedure periodically (due date and time)?

Say I have a record in a table, and this record has a "DATETIME" column; It is a DUE DATE and TIME. Whenever the server date reaches that date and time, it should notify the user (execute procedure...

View Article

Cursor inside Trigger not working

USE [ddb] GO SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER ON GO CREATE TRIGGER [dbo].[requeststrigger] ON [dbo].[requests] AFTER INSERT,UPDATE AS BEGIN DECLARE @email VARCHAR(400); DECLARE @firstname...

View Article

Rolling back the whole procedure (all statements)

How can I write the procedure in a way so that I can ROLLBACK all the INSERT, UPDATE and DELETE statements whenever ANY statement in it had an error. Please note that my procedure might and might not...

View Article


MySQL to MSSQL: IF(value=5,1,NULL) how to do it in MSSQL?

How can I convert this MySQL statement to MSSQL? IF(value=5,1,NULL) It is a simple IF statement that returns the first value if TRUE (1), and the second if FALSE (NULL) I am using this with PHP so it...

View Article


HOW TO SOLVE: Only functions and some extended stored procedures can be...

I have the following FUNCTION and PROCEDURE. When I call the function on a normal SELECT statement (ie. "SELECT dbo.CLIENT_DELETE('100');") it returns the following error: 'Only functions and some...

View Article

Sending SMTP mail in MSSQL 2008 R2 Express

I am trying to use this code to send SMTP mail in MSSQL 2008 R2 EXPRESS: [http://www.freevbcode.com/ShowCode.asp?ID=6699][1] But I am getting the following error: **Msg 15281, Level 16, State 1,...

View Article

PHP with MSSQL: strtotime() with MSSQL DATETIME column

So I have MSSQL datetime field, and in PHP I want to use this as a UNIX TIMESTAMP, because I want to use it with strtotime, in order to add 14 days into it. Eg. If it is stored in the MSSQL database...

View Article

Upgrading from SQL Server 2008 R2 Express to SQL Server 2008 R2 Enterprise

When I tried upgrading from SQL Server 2008 R2 Express to SQL Server 2008 R2 Enterprise, it passed all tests and then it failed at step "Select features", saying the following error: "There are no...

View Article


How to execute procedure periodically (due date and time)?

Say I have a record in a table, and this record has a "DATETIME" column; It is a DUE DATE and TIME. Whenever the server date reaches that date and time, it should notify the user (execute procedure...

View Article

Cursor inside Trigger not working

USE [ddb] GO SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER ON GO CREATE TRIGGER [dbo].[requeststrigger] ON [dbo].[requests] AFTER INSERT,UPDATE AS BEGIN DECLARE @email VARCHAR(400); DECLARE @firstname...

View Article


Rolling back the whole procedure (all statements)

How can I write the procedure in a way so that I can ROLLBACK all the INSERT, UPDATE and DELETE statements whenever ANY statement in it had an error. Please note that my procedure might and might not...

View Article
Browsing all 16 articles
Browse latest View live




Latest Images