Red Gate forums :: View topic - Issue - system_user becomes system_user() which is incorrect
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Compare 10
SQL Compare 10 forum

Issue - system_user becomes system_user() which is incorrect

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
tranquilizer



Joined: 18 Jan 2013
Posts: 2

PostPosted: Fri Jan 18, 2013 8:28 pm    Post subject: Issue - system_user becomes system_user() which is incorrect Reply with quote

I have a table creation script within which there is a column with a default constraint defined with a value of system_user.

After doing a sql compare, the syncronization script changes the default constraint definition to system_user() which is incorrect.

There is no system_user() function in sql server. It should just be system_user.

Example :-
Original script is -
CREATE TABLE [dbo].[Test]
(
[Test_ID] [int] IDENTITY(1,1) NOT NULL,
[User_Created] [varchar](100) NOT NULL DEFAULT (system_user)
)

After sql compare with a database which does not have this table, the syncronization script output is -
CREATE TABLE [dbo].[Test]
(
[Test_ID] [int] IDENTITY(1,1) NOT NULL,
[User_Created] [varchar](100) NOT NULL DEFAULT (system_user())
)

This syncronization script when executed on target server will throw error because there is no such function as system_user().

Please investigate.

Thanks!
Back to top
View user's profile Send private message
chriskelly



Joined: 19 Apr 2010
Posts: 308
Location: Cambridge, UK

PostPosted: Mon Jan 21, 2013 4:51 pm    Post subject: Reply with quote

Thank you for your post.

My thinking at the moment is that the SQL Compare engine is having problems interpreting the default value as a string " DEFAULT (system_user) ".

The usual form for this in t-sql is
Name varchar(255) DEFAULT 'string'

While SQL Server is able to correctly interpret the form of
Name varchar(255) DEFAULT (Sandnes)
as a string. The SQL Compare engine has not been designed to do so. Can you therefore try changing your original script (or write a test object) using the single quotes instead of the brackets and then test it with our tool.

Please can you let me know how you get on.
_________________
Chris Kelly
Technical Support Engineer
Back to top
View user's profile Send private message
tranquilizer



Joined: 18 Jan 2013
Posts: 2

PostPosted: Mon Jan 21, 2013 9:18 pm    Post subject: Reply with quote

Thank you for taking a look. But I am not sure if you understood the issue correctly.

I am not defining the default to be of string type value 'system_user'
I am defining the default to be of value returned by the sql server function system_user
and therefore the below definition -

[User_Created] [varchar](100) NOT NULL DEFAULT system_user
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group