Showing posts with label friends. Show all posts
Showing posts with label friends. Show all posts

Tuesday, March 20, 2012

an unkown insert type by me(!)

Hi Dear Coder Friends;

i just discovered below insert type in MSSQL 2005 Automatic creating insert sentence but i couldn't use because there is a syntax error.

INSERT INTO [KimlikBilgileri]

([CvId]

,[KimlikNo]

,[Ad]

,[Soyad]

,[Cinsiyet]

,[DogumTarihi]

,[UlkeId]

,[DogumYeri]

,[MedeniDurumu])

VALUES

(<CvId, int,>

,<KimlikNo, char(11),>

,<Ad, varchar(50),>

,<Soyad, varchar(50),>

,<Cinsiyet, char(5),>

,<DogumTarihi, smalldatetime,>

,<UlkeId, int,>

,<DogumYeri, varchar(50),>

,<MedeniDurumu, varchar(8),>)

Question for above;

-- What's this type called?

-- does it make any security bug like injections?

i want to use this one as a stored proc to add "create proc KimlikBilgilerInsert as ". So i think i don't have to declare one by one

am i right?

Thank you for your valuable knowledge Wink

The syntax error is due to the datatypes. Remove all the datatype indicators.

This is called an INSERT statement.

Yes, it is susceptible to SQL Injection -there are very long varchar(50) fields, and there is no data validation. I would consider where the values are gathered, and if from textboxes on a form, then I would put this statement in a stored procedure and add some data validation code.

Saturday, February 25, 2012

AMO:Quesiton About the DataSourceView

Hi, friends, thank you very much to read my question as below:

I 'am using the AMO, and meet a question about the DataSourceView object.

My question is very simple:

After I added a column into a source table in the SQL Server, how to get the change into the DataSourceView object?

Background:

I have a cube in my OLAP Server, and I connect with it in my application with AMO. My task is to add a new measure, mapping to a new column I just added into the source table, just like this:

Dim meas As Microsoft.AnalysisServices.Measure

meas = Mainform.tDatabase.Cubes(0).MeasureGroups(0).Measures.Add()
meas.Source = CreateDataItem(Mainform.tDatabase.DataSourceViews(0), TableName, ColumnName)

But my problem is that the table schema in the DataSourceViews(0) doesn't include the column just added.

How could I update the DataSourceViews? I tried the Update() method, but that's is used to update the the OLAP server, not what I want to do. I want to update the DataSourceViews object itself refering to the SQL Server's table schema.

Thanks!

Have you added the column to your datatable that you use to populate your DSV ?
|||

sorry, I dont' catch your mean. I have added the column to the source table in the database of the sql server 2005. What is your mean of "MY Datatable use to populate my DSV"? Perhaps, you could teach me how to populate my DSV based on the datatable in the sql server 2005.

Thanks.

|||Hi,

Take a look at this If you scroll down to the part where it says "DataSourceView Objects", you will see that they are using SQL to populate a datatable to fill the datasourceview. This is very similar to what you will do, You've added the new column in the table in your database, now you've got to query that column, to add it to the datatable.

Hope that makes sense,

C

AMO: Only need to use ProcessData?

Hi, friends, please look at this:

I add and delete some data records into the FactTable in the SQL Server(Not changing any structure), and want to process the cube by AMO. I only need to use the ProcessData on the cube, right?

I add and delete some data records into the DimentionTable in the SQL Server(Not changing any structure), and want to process the cube by AMO. I only need to use the ProcessUpdate on the dimention , right?,

Moved to Analysis Services|||please have a look. Thanks.|||

ivanchain wrote:

I add and delete some data records into the FactTable in the SQL Server(Not changing any structure), and want to process the cube by AMO. I only need to use the ProcessData on the cube, right?

You would also need to do a processIndex to get the aggregations and indexes processed (the cube would work, but could be quite slow if you have designed aggregations but don't do this)

ivanchain wrote:

I add and delete some data records into the DimentionTable in the SQL Server(Not changing any structure), and want to process the cube by AMO. I only need to use the ProcessUpdate on the dimention , right?,

Yes, ProcessUpdate is all you need to do to add/delete/update records in a dimension table.

|||

Thanks!

AMO: Only need to use ProcessData?

Hi, friends, please look at this:

I add and delete some data records into the FactTable in the SQL Server(Not changing any structure), and want to process the cube by AMO. I only need to use the ProcessData on the cube, right?

I add and delete some data records into the DimentionTable in the SQL Server(Not changing any structure), and want to process the cube by AMO. I only need to use the ProcessUpdate on the dimention , right?,

Moved to Analysis Services|||please have a look. Thanks.|||

ivanchain wrote:

I add and delete some data records into the FactTable in the SQL Server(Not changing any structure), and want to process the cube by AMO. I only need to use the ProcessData on the cube, right?

You would also need to do a processIndex to get the aggregations and indexes processed (the cube would work, but could be quite slow if you have designed aggregations but don't do this)

ivanchain wrote:

I add and delete some data records into the DimentionTable in the SQL Server(Not changing any structure), and want to process the cube by AMO. I only need to use the ProcessUpdate on the dimention , right?,

Yes, ProcessUpdate is all you need to do to add/delete/update records in a dimension table.

|||

Thanks!

Friday, February 24, 2012

AMO: How to ProcessFull a cube with no processing a Dimention?

Hi, friends, please have a look:

I just add a measure and do an Update to the cube object by AMO, and do a ProcessFull to the cube.

The problem is the ProcessFull will take a very long time. So I want to Process the cube with no processing the Dimentions, Could I do this?

Because I never change the Dimention, why the ProcessFull tot the cube will ALWAY process the dimentions by itself?

Thanks!

Hello! If you add a measure in a fact table you have actually change the whole structure of the cube and all aggregations will have to be rebuilt. That is why you will have to do a full process of the cube.

A full process of a dimension is only required if you change the structure like adding or changing user hierarchies and if you add or delete attributes. If this have not changed you can process(full) the cube and not the dimensions.

Processing dimensions normally takes less time than processing a cube(measure groups or partitions).

Adding calculated measures and other MDX -script objects do not require a full process. You can use process default in the user interface in BIDS to see that. I am not sure what that is called in AMO.

HTH

Thomas Ivarsson

|||

Thanks, Thomas.

Please just processfull the cube in the user interface in BIDS, NOT in AMO. You can see the process result report box, the ProcessFull to the cube will ALWAY make the dimentions be process ed automatically. Why and how to stop this?

|||

Hello! I think this can depend on a setting under "change setting" when you process the cube. Look for something like process affected objects.

HTH

Thomas Ivarsson

|||If you are doing this from BIDS, then adding a measure means you will need to re-deploy and if you have the default options set it will do a processDefault on the whole database. Which means that the cube that has been altered will be fully processed and the dimensions will all have processUpdate run on them to make sure that they have the latest information in them. If you want full control over the processing - do not use BIDS to process. Using XMLA commands from SSMS or ascmd is probably the best way to go. You could also write your own AMO utility in C# or VB.Net if you wanted.|||

Thanks Darren .

Then, you mean If I use AMO, and I use the cube(0).process(processFull), it WILL NOT make the dimention associated to be processed, right?

|||

A full process of a cube will always mean a full process of the dimensions.

HTH

Thomas Ivarsson

|||

ivanchain wrote:

Thanks Darren .

Then, you mean If I use AMO, and I use the cube(0).process(processFull), it WILL NOT make the dimention associated to be processed, right?

You can do cube(0).process(processDefault) to re-process the cube (and because you removed a measure, the Analysis Services server will decide to re-process the full measure group) without re-processing the dimensions. You can also call processDefault on the measure group, but it doesn't hurt to call it on the cube, the server will skip the other measure groups if they don't need to be re-processed.

The ProcessDefault option will only re-process what needs to be re-processed, if you did structural changes or not.

A description of the process types is available at: http://msdn2.microsoft.com/zh-cn/library/microsoft.analysisservices.processtype.aspx

|||

Adrian and Thomas are right, sorry I said processFull, but I was talking about processDefault.

Another good resource on processing is the Processing Architecture whitepaper: http://msdn2.microsoft.com/en-us/library/ms345142.aspx

|||

Thanks. From what you said, it means that I could always use ProcessDefault? Then why we need the ProcessFull?

Anyway, I will use ProcessDefault. OK?

|||

ProcessFull is to force a clean and full re-processing, if you want to do that.

|||

If I can say, I can always use ProcessDefault any time?

Thanks.

AMO: How to ProcessFull a cube with no processing a Dimention?

Hi, friends, please have a look:

I just add a measure and do an Update to the cube object by AMO, and do a ProcessFull to the cube.

The problem is the ProcessFull will take a very long time. So I want to Process the cube with no processing the Dimentions, Could I do this?

Because I never change the Dimention, why the ProcessFull tot the cube will ALWAY process the dimentions by itself?

Thanks!

Hello! If you add a measure in a fact table you have actually change the whole structure of the cube and all aggregations will have to be rebuilt. That is why you will have to do a full process of the cube.

A full process of a dimension is only required if you change the structure like adding or changing user hierarchies and if you add or delete attributes. If this have not changed you can process(full) the cube and not the dimensions.

Processing dimensions normally takes less time than processing a cube(measure groups or partitions).

Adding calculated measures and other MDX -script objects do not require a full process. You can use process default in the user interface in BIDS to see that. I am not sure what that is called in AMO.

HTH

Thomas Ivarsson

|||

Thanks, Thomas.

Please just processfull the cube in the user interface in BIDS, NOT in AMO. You can see the process result report box, the ProcessFull to the cube will ALWAY make the dimentions be process ed automatically. Why and how to stop this?

|||

Hello! I think this can depend on a setting under "change setting" when you process the cube. Look for something like process affected objects.

HTH

Thomas Ivarsson

|||If you are doing this from BIDS, then adding a measure means you will need to re-deploy and if you have the default options set it will do a processDefault on the whole database. Which means that the cube that has been altered will be fully processed and the dimensions will all have processUpdate run on them to make sure that they have the latest information in them. If you want full control over the processing - do not use BIDS to process. Using XMLA commands from SSMS or ascmd is probably the best way to go. You could also write your own AMO utility in C# or VB.Net if you wanted.|||

Thanks Darren .

Then, you mean If I use AMO, and I use the cube(0).process(processFull), it WILL NOT make the dimention associated to be processed, right?

|||

A full process of a cube will always mean a full process of the dimensions.

HTH

Thomas Ivarsson

|||

ivanchain wrote:

Thanks Darren .

Then, you mean If I use AMO, and I use the cube(0).process(processFull), it WILL NOT make the dimention associated to be processed, right?

You can do cube(0).process(processDefault) to re-process the cube (and because you removed a measure, the Analysis Services server will decide to re-process the full measure group) without re-processing the dimensions. You can also call processDefault on the measure group, but it doesn't hurt to call it on the cube, the server will skip the other measure groups if they don't need to be re-processed.

The ProcessDefault option will only re-process what needs to be re-processed, if you did structural changes or not.

A description of the process types is available at: http://msdn2.microsoft.com/zh-cn/library/microsoft.analysisservices.processtype.aspx

|||

Adrian and Thomas are right, sorry I said processFull, but I was talking about processDefault.

Another good resource on processing is the Processing Architecture whitepaper: http://msdn2.microsoft.com/en-us/library/ms345142.aspx

|||

Thanks. From what you said, it means that I could always use ProcessDefault? Then why we need the ProcessFull?

Anyway, I will use ProcessDefault. OK?

|||

ProcessFull is to force a clean and full re-processing, if you want to do that.

|||

If I can say, I can always use ProcessDefault any time?

Thanks.

AMO: How to process after adding a measure?

Hi, friends, please look this:

dim tDatabase as Microsoft.AnalysisServices.DataBase

tDatabase=Mainform.AnalysisDB 'here to refer it to an object

tDatabase..Cubes(0).MeasureGroups(0).Measures.Add() 'here to add a measure

tDatabase..Cubes(0).Update(Microsoft.AnalysisServices.UpdateOptions.ExpandFull)

tDatabase.Process(Microsoft.AnalysisServices.ProcessType.ProcessUpdate)

I want to know if it's correct to use the ProcessType.ProcessUpdate option?

After adding/dropping a measure/KPI, what ProcessType need I use?

After update a dsv, what ProcessType need I use?

Thanks!

To the best of my knowledge processUpdate is only valid for dimensions (see http://msdn2.microsoft.com/en-us/library/ms345142.aspx)

If you add a measure you are changing the structure of the cube which will invalidate the cube, the easiest way to get the cube "fully operational" again would be to do a processFull. The same thing applies when removing a measure.

I don't think you need to do any processing for calculated measures or KPI's as these elements do not have storage structures associated with them.

As far as the DSV is concerned, it depends on the type of change you are making. Changing the DSV will not invalidate the cube structure as such. The DSV is an abstraction for the data source(s) of the cube. It depends on the type of changes you are making. If the data that comes out of the DSV is affected in any way, you would need to re-process the cube to get it to reflect these changes. More importantly, if you change data types or remove elements that other objects such as dimensions, partitions, measures etc. are dependant upon, then you would need to change those objects too and that would most likely require full re-processing.

|||

Thank you Gosbell ,

Please tell me if I drop or add a measure, if I always need to ProcessFull?

As you know, ProcessFull will take a very long time, specially when the cube is huge. I don't think the client could stand the long time just because he/she add or delete a measure thourgh my application with AMO.

How to deal with this problem?

|||

Please tell me if I drop or add a measure, if I always need to ProcessFull?

Yes, you do. You can add and remove calculations easy enough, but adding and removing measures that are linked to fact table columns changes the fundamental data structures. Adding and removing measures to a measureGroup is not really something to be done lightly, especially once a large cube has been deployed.

The bare minimum that you could do to get the cubes "queryable" again would be a processStructure followed by a processData, but the cubes would not have any indexes or aggregations, so they could be quite slow. Doing a processIndex would add the indexes and aggregations, but processFull is the effectively the same as doing all three of these operations individually. You might see a slight performance advantage by doing the three operations individually, but it would not be a dramatic change.

|||I see that. Thanks again, Gosbell!

AMO: how to get a SourceColumnName from a measure object?

Hi, friends, please look this:

In AMO, I can get a measure object:

Dim meas As Microsoft.AnalysisServices.Measure

meas = tDatabase.Cubes(0).MeasureGroups(0).Measures(0)

Dim dt as DataItem= meas.source

Now I want to find the meas' SourceColumnName, that is, the ColumnName of the measure mapped to.

But how? I tried the meas.source's property, but did not find anyone like a Name.

Please help me.

Thanks!

Hi there,

Try

tDatabase.Cubes(0).MeasureGroups(0).Measures(0).Source.Source.ToString()

C

|||

Thanks!|||

The source of a Measure can be either a:

1. ColumnBinding (the common case): this points (with the TableID and ColumnID properties) to a System.Data.DataColumn in the DataSourceView of the Cube (specified in the Cube.Source property). This DataColumn can be either a regular column or a calculated column, there are these special extended properties (in the DataColumn.ExtendedProperties collection) to consider: DbColumnName (provides the real column name in the relational table, this is usually the same with the DataColumn.ColumnName) and DbExpression (provides the SQL expression for a calculated column)

2. RowBinding: used for row count measures, points (with the TableID property) to the System.Data.DataTable in the DataSourceView

3. MeasureBinding: used for linked measures (in a linked measure group), points (with the MeasureID property) to the measure to link

Adrian Dumitrascu

|||

I am trying to , via AMO, get the type of Binding for a measure (column, row, measure) and then return, when the type is columnbinding, the columnid and tableid from the DSV. Could you provide an example?

AMO: how to get a SourceColumnName from a measure object?

Hi, friends, please look this:

In AMO, I can get a measure object:

Dim meas As Microsoft.AnalysisServices.Measure

meas = tDatabase.Cubes(0).MeasureGroups(0).Measures(0)

Dim dt as DataItem= meas.source

Now I want to find the meas' SourceColumnName, that is, the ColumnName of the measure mapped to.

But how? I tried the meas.source's property, but did not find anyone like a Name.

Please help me.

Thanks!

Hi there,

Try

tDatabase.Cubes(0).MeasureGroups(0).Measures(0).Source.Source.ToString()

C

|||

Thanks!|||

The source of a Measure can be either a:

1. ColumnBinding (the common case): this points (with the TableID and ColumnID properties) to a System.Data.DataColumn in the DataSourceView of the Cube (specified in the Cube.Source property). This DataColumn can be either a regular column or a calculated column, there are these special extended properties (in the DataColumn.ExtendedProperties collection) to consider: DbColumnName (provides the real column name in the relational table, this is usually the same with the DataColumn.ColumnName) and DbExpression (provides the SQL expression for a calculated column)

2. RowBinding: used for row count measures, points (with the TableID property) to the System.Data.DataTable in the DataSourceView

3. MeasureBinding: used for linked measures (in a linked measure group), points (with the MeasureID property) to the measure to link

Adrian Dumitrascu

|||

I am trying to , via AMO, get the type of Binding for a measure (column, row, measure) and then return, when the type is columnbinding, the columnid and tableid from the DSV. Could you provide an example?

AMO: Could I processfull on a measuregroup ONLY?

hi, friends,

I add/delete a measure in AMO. I want to know I need to processfull the whole cube or ONLY the measuregroup that associated?

Thanks!

I am quoting the Darren Gospbell's Reply to this quetion raised earlier in this forum:

"If you add a measure you are changing the structure of the cube which will invalidate the cube, the easiest way to get the cube "fully operational" again would be to do a processFull. The same thing applies when removing a measure.

Thanks

Subhash Subramanyam

|||

You mean that I need to process the WHOLE cube?

But I only process the measuregroup associated to the measure I just added, and no error reported.

I still think I need only to process the measuregroup associated.

What do you think?

Thanks.

|||

You only need to process the MeasureGroup. It is true that adding or removing a measure is a structural change that would clear the data (so re-processing is required), but the MeasureGroup is the most immediate parent containing the Partitions (who store the actual data) and Aggregations (who would need to be re-generated), so processing just the MeasureGroup should be enough.

But when saving the MeasureGroup (because you deleted the Measure), you might need to re-save the entire cube (with the ExpandFull option passed to the Update method) if you have Perspectives objects using that Measure.

Adrian Dumitrascu

|||

Thank you all!

AMO: Could I processfull on a measuregroup ONLY?

hi, friends,

I add/delete a measure in AMO. I want to know I need to processfull the whole cube or ONLY the measuregroup that associated?

Thanks!

I am quoting the Darren Gospbell's Reply to this quetion raised earlier in this forum:

"If you add a measure you are changing the structure of the cube which will invalidate the cube, the easiest way to get the cube "fully operational" again would be to do a processFull. The same thing applies when removing a measure.

Thanks

Subhash Subramanyam

|||

You mean that I need to process the WHOLE cube?

But I only process the measuregroup associated to the measure I just added, and no error reported.

I still think I need only to process the measuregroup associated.

What do you think?

Thanks.

|||

You only need to process the MeasureGroup. It is true that adding or removing a measure is a structural change that would clear the data (so re-processing is required), but the MeasureGroup is the most immediate parent containing the Partitions (who store the actual data) and Aggregations (who would need to be re-generated), so processing just the MeasureGroup should be enough.

But when saving the MeasureGroup (because you deleted the Measure), you might need to re-save the entire cube (with the ExpandFull option passed to the Update method) if you have Perspectives objects using that Measure.

Adrian Dumitrascu

|||

Thank you all!

AMO: Can''t update dsv when delete a column

Hi, friends, please have a look at this:

I am using AMO, and I do this:

1 step: I drop a column from the source table by SQL:

ALTER TABLE TargetTable Drop COLUMN ColumnName

2 step: I try to update the dsv by AMO:

Dim adapter As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter( _
"SELECT * FROM [dbo].[" + tableName + "] WHERE 1=0", connection)
Dim i As Integer

For i = 0 To dsv.Schema.Tables.Count - 1
If dsv.Schema.Tables(i).TableName = "dbo_" & tableName Then
MessageBox.Show("Before dsv.Schema.Tables.Count:" & dsv.Schema.Tables(i).Columns.Count)
Dim dataTable As DataTable = adapter.FillSchema(dsv.Schema.Tables(i), SchemaType.Mapped)
MessageBox.Show("After dsv.Schema.Tables.Count:" & dsv.Schema.Tables(i).Columns.Count)
End If

Next

But, from the first messagebox and the second messagebox, I see the dsv is not updated after I delete the column.

3 step: I save the dsv to the server.

If Mainform.tDatabase.DataSourceViews.Count > 0 Then
Mainform.tDatabase.DataSourceViews(0).Update(Microsoft.AnalysisServices.UpdateOptions.ExpandFull)
End If

Then I check the server, the dsv still include the columnname I have deleted.

Why and how to update the dsv after I delete a column?

Thanks!

ivanchain wrote:

Dim dataTable As DataTable = adapter.FillSchema(dsv.Schema.Tables(i), SchemaType.Mapped)

ivanchain wrote:

But, from the first messagebox and the second messagebox, I see the dsv is not updated after I delete the column

Let's also check if the returned 'dataTable' still contains the column you deleted. If it does contain the column, then we need to double check the table name and its columns in SQL Server.If the returned 'dataTable' doesn't contain the column, it looks like you need to replace the table in the DSV with this returned 'dataTable', but according to documentation at http://msdn2.microsoft.com/en-us/library/152bda9x.aspx, this should not be the case.

The rest of the code looks good, the problem is not in AMO, but in the FillSchema area.

Adrian Dumitrascu

|||

I tried what you said:

Let's also check if the returned 'dataTable' still contains the column you deleted. If it does contain the column, then we need to double check the table name and its columns in SQL Server.

Yes, the returned 'dataTable' still contains the column I deleted. But I don't know what you exactly mean of DOUBLE CHECK the table name and its columns in SQL Server? I need to check what?

Thank you!

|||

The problem is still there.... help!

thanks.

|||

The only ideas that I have are:

- double check that the database name (that you use in the code) is the same with the database on which you removed the column from the table. There might be a concidence that you have 2 databases containing the same table name and column name, you deleted from one, but the code works on the other database by chance (since I don't see in the code where you explicitly chose the database on which to run the SELECT statement)

- double check that the name and the schema, 'dbo', of the table you use in the code are the same as the schema and the name of the table from which you deleted the column

|||

Thanks, Adrian. But, I don't think it's about the NAME of the table. Because my code could update dsv when I add a column into the SQL table in the SQL Server. If the name of the table is wrong, it will also not update when adding, right?

Thanks!

AMO: Can't update dsv when delete a column

Hi, friends, please have a look at this:

I am using AMO, and I do this:

1 step: I drop a column from the source table by SQL:

ALTER TABLE TargetTable Drop COLUMN ColumnName

2 step: I try to update the dsv by AMO:

Dim adapter As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter( _
"SELECT * FROM [dbo].[" + tableName + "] WHERE 1=0", connection)
Dim i As Integer

For i = 0 To dsv.Schema.Tables.Count - 1
If dsv.Schema.Tables(i).TableName = "dbo_" & tableName Then
MessageBox.Show("Before dsv.Schema.Tables.Count:" & dsv.Schema.Tables(i).Columns.Count)
Dim dataTable As DataTable = adapter.FillSchema(dsv.Schema.Tables(i), SchemaType.Mapped)
MessageBox.Show("After dsv.Schema.Tables.Count:" & dsv.Schema.Tables(i).Columns.Count)
End If

Next

But, from the first messagebox and the second messagebox, I see the dsv is not updated after I delete the column.

3 step: I save the dsv to the server.

If Mainform.tDatabase.DataSourceViews.Count > 0 Then
Mainform.tDatabase.DataSourceViews(0).Update(Microsoft.AnalysisServices.UpdateOptions.ExpandFull)
End If

Then I check the server, the dsv still include the columnname I have deleted.

Why and how to update the dsv after I delete a column?

Thanks!

ivanchain wrote:

Dim dataTable As DataTable = adapter.FillSchema(dsv.Schema.Tables(i), SchemaType.Mapped)

ivanchain wrote:

But, from the first messagebox and the second messagebox, I see the dsv is not updated after I delete the column

Let's also check if the returned 'dataTable' still contains the column you deleted. If it does contain the column, then we need to double check the table name and its columns in SQL Server.If the returned 'dataTable' doesn't contain the column, it looks like you need to replace the table in the DSV with this returned 'dataTable', but according to documentation at http://msdn2.microsoft.com/en-us/library/152bda9x.aspx, this should not be the case.

The rest of the code looks good, the problem is not in AMO, but in the FillSchema area.

Adrian Dumitrascu

|||

I tried what you said:

Let's also check if the returned 'dataTable' still contains the column you deleted. If it does contain the column, then we need to double check the table name and its columns in SQL Server.

Yes, the returned 'dataTable' still contains the column I deleted. But I don't know what you exactly mean of DOUBLE CHECK the table name and its columns in SQL Server? I need to check what?

Thank you!

|||

The problem is still there.... help!

thanks.

|||

The only ideas that I have are:

- double check that the database name (that you use in the code) is the same with the database on which you removed the column from the table. There might be a concidence that you have 2 databases containing the same table name and column name, you deleted from one, but the code works on the other database by chance (since I don't see in the code where you explicitly chose the database on which to run the SELECT statement)

- double check that the name and the schema, 'dbo', of the table you use in the code are the same as the schema and the name of the table from which you deleted the column

|||

Thanks, Adrian. But, I don't think it's about the NAME of the table. Because my code could update dsv when I add a column into the SQL table in the SQL Server. If the name of the table is wrong, it will also not update when adding, right?

Thanks!