|
jschell wrote: I took that to mean that one should use GUID - always (implicit within "never").
No, that's not what I meant, although many seem to take it that way.
|
|
|
|
|
I am trying to create a report reading from various databases. I can see that it is possible to write code for table cells in the report. But I don't like the small window that is provided to you for writing code. I would prefer writing code in a .NET library (a separate project) and then reference the code from the report.
Is it possible?
If yes, how do I reference code in my own custom library from my report?
|
|
|
|
|
Found the solution myself:
1. Place custom assembly in folder: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies
2. Right click report (in design view), select "Report Properties", then add reference to the custom assembly.
Thanks to myself.
|
|
|
|
|
Xiangyang Liu 刘向阳 wrote: Thanks to myself
+5 for talking to yourself and for posting the solution - might help someone who is working on the same
I are Troll
|
|
|
|
|
Hi,
I have problem where I have get list of all tables on which full text index can be applied with their key names.
Please help, its urgent.
Thanks.
|
|
|
|
|
awadhendra tiwari wrote: I have problem where I have get list of all tables on which full text index can be applied with their key names.
SELECT TC.[TABLE_SCHEMA]
, TC.[TABLE_NAME]
, CCU.[COLUMN_NAME]
, TC.[CONSTRAINT_NAME]
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC
JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE CCU ON TC.[CONSTRAINT_NAME] = CCU.[CONSTRAINT_NAME]
WHERE TC.[CONSTRAINT_TYPE] = 'PRIMARY KEY'
AND EXISTS (
SELECT *
FROM INFORMATION_SCHEMA.COLUMNS C
WHERE C.[TABLE_NAME] = TC.[TABLE_NAME]
AND C.[DATA_TYPE] IN (
'char',
'varchar',
'nchar',
'nvarchar',
'text',
'ntext',
'image',
'xml',
'varbinary',
'varbinary(max)'
)
)
ORDER BY TC.[TABLE_NAME]
awadhendra tiwari wrote: its urgent
The people that visit this site do so in their spare time. Rushing would be inappropriate.
I are Troll
|
|
|
|
|
Hello All,
Whenever I run any simple select query, it shows me following message in Execution Plan. I have created relevant indexes on the table.
Query Cost (relative to the batch): 100%
Can anyone tell how can I reduce this Query Cost ?
Thanks
|
|
|
|
|
You are misunderstanding what Query Cost is. If you run any single query, the cost will always be 100%. If you run multiple queries, the total cost of all of the queries in the batch added together will equal 100%. The value is used to compare the relative cost of each query in the batch as the message says.
|
|
|
|
|
Hello,
I have the following situation which I can seem to resolve. When I do an "ALTER TABLE" in mysql (v5.5) it hangs in with "waiting for metadata lock". Here is how I got there:
- i have an xml which i want to import into a table; i use the elements in the xml to create columns in the table like this:
XML example
<name> some name </name> <address>dsada</address>
there are some nodes in the xml that have different number of elements, like:
<name> some name </name> <address>ds adsa</address> <phone> fndjsf</phone>
SQL queries
create table `person` ( `id` bigint(12) unsigned NOT NULL auto_increment ,`name` varchar(200) NOT NULL ,`address` varchar(250) NOT NULL ,PRIMARY KEY (`id`),) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into person(name, address) values ...
the column names are read from the xml, so are the values. If the for loop reads a column name that hasn't been created in the table yet, like "phone" it returns a sql exception "column name "phone" not found" and tries an alter table before inserting the values
alter table 'person' ADD COLUMN `phone` varchar(20) NULL default NULL;
here is where the program hangs. i've checked in mysql admin for the session and the state is "waiting for metadata lock"
how can i pass this? or how do i remove the table metadata lock created by the previous insert which raised the exception. (the import is made in java that's why i use a for loop to parse the xml and get the element names and values)
Thanks
|
|
|
|
|
You may need to commit your changes so that the alter table command will not wait.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
i am commiting the changes. i have also tried to unlock tables before alter but to no success. think i have to re-think the whole process.
|
|
|
|
|
Hi !
I have a very odd problem.
I am using LinqtoSql in my project in c#. , and what i do is i create a new table and set its column through sql server management studio express (2008 r2) , and I add a class file to the project(in visual studio) and using linq i do mapping of that table i made in Sql studio.
e.g
[column]
public string firstname;
[column]
public string lname;
etc etc.
My question is , if i want to make a new table and add its column etc through the windows forms application in c# at runtime (using sql commands etc) , how can i use linq to automatically map the newly created table without manually editing the code?
What should i do, i have to use LINQ to SQL.. PLZ HELP
|
|
|
|
|
OK, so you create your DB table at run-time. But what about the class to which you are mapping the newly created table, is it created at run-time as well? If it is (i.e. you generate and compile the code, or emit CLR byte code) you could provide [column] attributes too: there is no "LINQ-specific magic" in .NET, so you can do nearly anything the compiler can.
|
|
|
|
|
Thats the problem about classes .
that how can i add new class file to the project and add attributes at runtime?
|
|
|
|
|
You cannot add new classes to your project at run-time. You need to write a program that creates classes dynamically, for example using CodeDom[^] or Emit[^] APIs of .NET. CodeProject has examples of using both these sets of APIs[^].
|
|
|
|
|
I am using Microsoft SQL Server Management Studio 2005 v9.00.4035.00. When I view an existing stored procedure and copy the text or grid results to a new query window there are always several spaces after each line, and in some cases a ton of extra space. Before I commit any modifications to the stored proc I have to take the text into a text editor and trim the trailing spaces (okay, I guess I don't HAVE to but it just annoys me).
I was wondering if anyone has a better method of accomplishing this goal. I can't seem to find anything in options or any plugins I can install that will do this. Every time I try and Google this all I get is results on how to trim trailing spaces from the dataset you are returning.
Thanks in advance for your help!
|
|
|
|
|
Is you output datatype TEXT or CHAR, you may want to look at VARCHAR.
|
|
|
|
|
Thanks for your response on this however I am not referring to any output that I can control the datatype of. I am referring to the text that SMS brings up when you view an existing stored proc or view.
|
|
|
|
|
Okay I see what you mean...
I have not had a big problem with this as I usually have no trailing characters.
There might be a setting about trailing characters, but I cannot remember.
Sorry I cannot help.
djj
|
|
|
|
|
Hi all,
I uploaded some data to SQL Server 2008 from Excel.The table has 4 Fields,After upload the data to Database some of the data in fourth fields are NULL.I need to update the data from first as follows
Field1 , Field2 , Field3 , Field4
ABC_XYZ_123 , Office , 432322 , Null
XYV_PVC_321 , House , 908000 , 321
MBV_DHC_908 , House , 751232 , 908
MNP_BNM_876 , Office , 125152 , 876
As mentioned above,I need to update first row with 123 which already have in first field.
please help me to find to query for solvng above issue.
thanks
|
|
|
|
|
here it is
UPDATE mytable
SET field4 =
(SELECT RIGHT(mt.field1,CHARINDEX('_',mt.field1)-1)
FROM mytable mt
WHERE mt.field1 = mytable.field1
)
SELECT * FROM mytable
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
thanks for you reply.let me try with it
|
|
|
|
|
That should works without problem, I tested it and it worked.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
Hello,
I tried with above query.But it extracting 10 Digits.I dont know why.I have some datas in Field4 like this "74_125352" actually i need 125352.
modified on Sunday, May 8, 2011 1:46 AM
|
|
|
|
|
I'm trying to install MSSQL EXPRESS 2008 on my companies work computer.
I have the local admin right,just not the super admin. it gives me this not enough permission error.
When I did finally successfully install the MSSQL. It just that it gives these errors
2011-04-28 11:50:32.05 spid51 Error: 17204, Severity: 16, State: 1.
2011-04-28 11:50:32.05 spid51 FCB::Open failed: Could not open file e:\sql10_main_t.obj.x86fre\sql\mkmastr\databases\objfre\i386\model.mdf for file number 1. OS error: 3(The system cannot find the path specified.).
2011-04-28 11:50:32.05 spid51 Error: 17207, Severity: 16, State: 1.
2011-04-28 11:50:32.05 spid51 FileMgr::StartLogFiles: Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file 'e:\sql10_main_t.obj.x86fre\sql\mkmastr\databases\objfre\i386\modellog.ldf'. Diagnose and correct the operating system error, and retry the operation.
I did do some searching online. It says that this is caused because i wasn't able to finish the installation.
Is there any way to fix this or install the MSSQL? Since I'm just a normal dude in this company. There's no way I can get the super admin right. or even create another user account. Any help?
#EDIT all installation is directed to c:\ only. But it seems the default is e:\ weird setting presuming everyone has an E:\
modified on Thursday, April 28, 2011 4:29 AM
|
|
|
|