Yii Framework Forum: Gii Model Table Name Mssql - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Gii Model Table Name Mssql Rate Topic: -----

#1 User is offline   voime 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 09-June 11

Posted 18 July 2013 - 06:13 AM

Hi
I have problem making Models with Gii.
I use MS SQL server for database.
If i type table names autocomplete shows me tables with Schema_name$table_name like E-FARMER-TEST$Customer.

Attached File  gii_table_names.jpg (70.6K)
Number of downloads: 19

If pressing Preview button table name got error "Table Name should only contain word characters, dots, and an optional ending asterisk."

Attached File  gii_table_error.jpg (10.31K)
Number of downloads: 17

If try insert table name "Customer" then got error "Table 'Customer' does not exist."

Yii::app()->db->schema->tableNames; shows me all table names like E-FARMER-TEST$Customer

EDIT:
I created model manually. Table works.
	
public function tableName()
	{
		return 'E-FARMER-TEST$Customer';
	}

But i have now problem with columns. Column names contains space, dollar, sign and percent symbols. (like Unit Price, Prepayment %, Sell-to Addr, [Fax no_])

This post has been edited by voime: 18 July 2013 - 11:26 AM

0

#2 User is offline   redyopante 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 05-September 13

Posted 05 January 2014 - 11:19 PM

View Postvoime, on 18 July 2013 - 06:13 AM, said:

Hi
I have problem making Models with Gii.
I use MS SQL server for database.
If i type table names autocomplete shows me tables with Schema_name$table_name like E-FARMER-TEST$Customer.

Attachment gii_table_names.jpg

If pressing Preview button table name got error "Table Name should only contain word characters, dots, and an optional ending asterisk."

Attachment gii_table_error.jpg

If try insert table name "Customer" then got error "Table 'Customer' does not exist."

Yii::app()->db->schema->tableNames; shows me all table names like E-FARMER-TEST$Customer

EDIT:
I created model manually. Table works.
	
public function tableName()
	{
		return 'E-FARMER-TEST$Customer';
	}

But i have now problem with columns. Column names contains space, dollar, sign and percent symbols. (like Unit Price, Prepayment %, Sell-to Addr, [Fax no_])


Dear Voime,.
i also have the same problem,.
when i use giix model generator,.it looks like i success to connect with sql server 2000
Attached File  giix model generator.JPG (44.28K)
Number of downloads: 10

but when i click button preview,. giix was error,. table 'user' does not exist
Attached File  error.JPG (46.21K)
Number of downloads: 11

is there anyone can solve this problem??? :-[
thank you
regards,
Redy
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users