database replication (MSA)
I'm doing database replication from one ASE 12.5 into another ASE 12.5.
In the primary database there are tables with column names which are
SQL keywords like "from", "end". These columns were defined and used
with "[From] int" syntax and caused no problems whatsoever in the primary
database. RepServ attemptsto replicate updates to such tables
result in the messages like:
E. 2004/10/01 14:18:58. ERROR #1028 DSI EXEC(108(1) REPORT.real) - dsiqmint.c(3034)
Message from server: Message: 156, State 2, Severity 15 --
'Incorrect syntax near the keyw...dynamic sql with variable column name
I want to give select list(columan names) as variable to the dynamic sql
is this possible ?
sql statement that I wrote below :
Sqlstatement = 'SELECT ? FROM TABLE_NAME
WHERE TABLE_NAME.COLUMN1 ="'+variable1+'" and &
TABLE_NAME.COLUMN2 = "'+variable2+'" and &
TABLE_NAME.COLUMN3 = "'+variable3+'" and &
TABLE_NAME.COLUMN3 = "'+variable3+'"'
PREPARE SQLSA FROM :Sqlstatement ;
DESCRIBE ...Dynamic column names in T-SQL?
Does anyone know of a clever hack that can be used to generate column names
on the fly, either from local variables or values in a temp table?
Robert Gumpertz wrote:
> Does anyone know of a clever hack that can be used to generate column names
> on the fly, either from local variables or values in a temp table?
For what purpose? I'm not following where you're going with this?
(maybe I need some caffeine?)
Mark A. Parsons
Iron Horse, Inc.
This is a reporting application where the user can submit a random list of
states; the result is a count by categ...DW Designer Column Name vs. Database Column name use in expressions
Can you access the DW Designer column name in expressions (I have used the
database column name, but have had no luck figuring out how to access the
Designer column name).
I'm not sure you can. What are you trying to accomplish? There might
be another way of doing it.
Download an evaluation version of DataWindow .NET 1.5 Today!:
DataWindow.NET code examples available on CodeXchange:
PowerBuilder 10.5 Bet...Dynamically setting the column name on a SQL query
Can anyone show me or tell if the following is possible.
I have a SQL query as shown below:
SQL = "SELECT revenue_forecast.oct AS 'revenue' ...........
What I need to do is dynamically set the column in this SQL query. So i need to be able to place a variable in the part after the revenue_forecast "." .
Can someone show me how to do this?
It depends on your data source, but most data sources do not allow you to parameterize column names. You have a couple of choices. One is to concatenate the name into the string as in...
SQL = "SELECT reven...Showing my own column names instead of database column names in datagridview-windows app. C#.net
HiI already bind a DataGridView to a databse. My DataGridView is showing column names as it is in the table. I want to show user-friendly column names in the grid instead of column names in the database table. Please help me in this reagard. Thanx in advance
Your statement indicates to me that your columns are dynamically added to the grid, that's why it's showing the database column names.
You can show user-friendly column names by changing your query like so:
SELECT fName as 'First Name' FROM Users.DarmarkMark as Answer, if this reply answers your post.
Go to "E...Detecting column names, tables, databases, SQL server.......
Will someone please point me to a location where I can find good material on ADO.NET? To be more specific, I'm mostly looking for explanations on how to, _from my application_, detect column names, number of records in tables, tables in databases, databases on SQL server if there is any on machine which runs application (nice hierarchy? :)
If you don't know any location but can help me out with few examples or telling me what classes to use/look for that'll be nice too.
Thanks in advance to anyone who helps ;)
Check out sample code that can give you some idea...
Sushila ...Dynamically name columns in dynamically created datagrid
I am using code that I found on the net to take a datatable, drop it into a datagrid, and then export the whole thing as an excel spreadsheet.
So far for the small numberes I have tried it works. Currently I have an application where the number of columns ranges between 40 and 70.
The problem that I have is I want the first row to have names which are meaningful to the user, but I don't want to rename my datatable columns, only the datagrid columns. Right now the Excel column names are the same as the datatable names. Those names are meaningful to me (the programmer) but meaningless to...SQL: Column names, can ONLY get "name" instead of "table.name"
When iterating through column names returned from a query, I need to get "table.name" rather than just "name"
Check it out:
If I have an SQL statement "SELECT table1.ID, table2.ID FROM table1, table2;"
And table1 has a column name 'ID'
and table2 has a column name 'ID' aswell,
and i run the query, the dataset will contain column names 'ID' and 'ID'
instead of 'table1.ID' and 'table2.ID'
It is extremely important that I can differenciate between the 2 fields, and know where each of them come from.
The same thing happen...How to use a full column name (table name and column name) with a DataReader
Hi, I have a problem retrieving the data with a DataReader from a stored proc that performs a join of two table with the same column's names but different data.
Let me explain with an example:
I have two tables:
Table1: Id, Name
Table2: Id, Name, IdTable1
The sproc is something like this:
CREATE PROCEDURE [dbo].[SearchByName]
FROM dbo.Table1, dbo.Table2
WHERE Table1.Id = Table2.IdTable1
AND Table1.Name LIKE '%' + @Name + '%'
And my c# code is something like this:
Database db = Databas...SQL query to one column od database into two columns
Hi,I have a empskill Table which has 3 Columns (1) EmpID (2) SkillTypeID and (3) CourseID.Now SkillTypeID column has data 1 or 2 .......in here 1 means Primary Skill and 2 means Secondary Skill. CourseID will reflect the ID's of subjects like c#,SQL,etc I need a Query which will count the number of primary skilled and number of secondary skilled persons based on subject and will display as followsCOURSE ID SKILL TYPE 21 222 &n...Accessing table names or column names having underscores from a database from ASP.
I do not have much knowledge about ASP or ASP.Net.
I have a SQL Server 2000 database where the tablenames and column names have underscores.
Ex: Table: SALES_ORDERS
My doubt is:
'Is there any problem if I try to access the above table or column from ASP or ASP.Net".
Please can you give a definitive answer to this.
there should be no prb...as far as i know.
hth***********************Dinakar NethiLife is short. Enjoy it.***********************...How to get server name and databases name from a server using SQL Command...
can anyone tell meHow to get server name and databases name from a server using SQL Command...i m using sql server 2000(T-SQL)-- "Mark As Answer" If my reply helped you --
Use @@SERVERNAME to find the server name -select @@SERVERNAME& this to find the current database name -select db_name()M.V. 'Anil' Radhakrishna Web Development Tips, Tricks & Trivia | My Code Gallery Recent article - How To Create a Custom IE8 Accelerator
thanks..... -- "Mark As Answer" If my reply helped you --...SQL query returns 'No column name' as a column heading
hi,I'm trying to execute this query in SQL Server 2005 Express Edition, the problem is in the column heading of the result for the majorName fieldSELECT studentID,fname,mname,lname,familyName,gpa ,(SELECT majorName AS major FROM major WHERE majorID=(SELECT majorID FROM studentmajorWHERE studentID='0000000'))FROM student WHERE studentID='0000000'; Why the result of this query returns 'No column name' as a label for the majorName field? I use the AS clause to allows the column to be named, the column heading of the result table still 'No column name&...