15,892,927 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Umer Akram (Top 31 by date)
Umer Akram
18-Sep-15 7:36am
View
Deleted
how about using SQL Server Import / Export utility to import the CSV?
Umer Akram
18-Sep-15 7:36am
View
how about using SQL Server Import / Export utility to import the CSV?
Umer Akram
18-Feb-15 2:56am
View
the query you shared doesn't have a varchar/nvarchar/char column in it.
2ndly you if you use INSERT INTO ... SELECT as Mika suggested. you shouldn't be having this kind of issue.
Umer Akram
18-Feb-15 2:52am
View
what have you managed to do so far. you didn't share your idea/ design ?
Umer Akram
16-Feb-15 7:06am
View
hmmmm .... another crosstab table requirement. what is your actual problem???
Umer Akram
29-Jan-15 5:54am
View
can you share the exact error ?
Umer Akram
29-Jan-15 5:06am
View
Once suggestion, you should not change the expression in a case which can cause confusion:
IF A > B THEN 'yes'
instead of using B > A
you should be using something like this:
IF A < B THEN 'No'.
for the said issue, share sample data for table tbl_keywordposition and share your desired output. as
Umer Akram
29-Jan-15 4:49am
View
provide table structures with sample data and also share desire output. provided information is not enough.
Umer Akram
29-Jan-15 3:00am
View
you should use column mappings something like
bulkCopy.ColumnMappings.Add("col1", "dt_col1");
bulkCopy.ColumnMappings.Add("col2", "dt_col2");
sqlBulkCopy.DestinationTableName = "dbo.TDSM";
and try it.
bulkCopy.WriteToServer(dt);
Umer Akram
28-Jan-15 8:30am
View
This means that you need to validate your select statement. you might be using a column(s) which are not related to the tables.
how you are creating your select query? can you share the logic?
Umer Akram
28-Jan-15 8:26am
View
this means your select clause is also dynamic means?
quick question, are the used table are also dynamic means generated on the run time ?
you have to break your code to narrow down the issue, i would suggest to validate the FROM WHERE clause 1st something like this. this will ensure that your query base is correct.
N'Select *
FROM ' + @Table_Name + ' AS t1
LEFT OUTER JOIN ' + @Table_Name2 + ' AS t2
ON t1."Projektdefinition DB" = t2."Projektdefinition DB"
WHERE t1.[DBN - bereich] = ''PB'' AND t2.[DBN - bereich] = ''PB''' +
' ORDER BY t1.[Projektdefinition DB] ASC '
one more thing what is the data type of the variables @Table_Name , @Table_Name2
and how you are execution this query ?
Umer Akram
28-Jan-15 8:26am
View
my mistake, better reply to him then :)
Umer Akram
28-Jan-15 8:08am
View
replied to OP.
Umer Akram
28-Jan-15 8:00am
View
glad to help you
Umer Akram
28-Jan-15 7:49am
View
you are welcome :)
Umer Akram
28-Jan-15 7:48am
View
are you looking at the right server & database to which your connection string is pointing to ?
Umer Akram
28-Jan-15 7:37am
View
Just removed the extra ")" to avoid any syntax error. here is the updated query.rest of the logic is same.
select c.Status,c.InterviewDate,c.InterviewerName,c.DateOfConfirmation,c.DateOfJoining,c.LastWorkday, c.Contact,d.DesignationOffered,d.Duration,d.SalaryOffered
into newTableName
from CandidateSelection1 c join Designation d
on c.CandidateId=d.DesignationId
Umer Akram
28-Jan-15 7:34am
View
what error its gives you?
which user authentication was used to login to sql server?
Umer Akram
28-Jan-15 7:32am
View
its a repost of the following question .
Update trigger not firing properly
question is related with that. better ask question on the same thread instead of creating a new one.
Umer Akram
28-Jan-15 7:17am
View
quick question what error it gives you when you execute this query? if you want to use space in side column name i would suggest to use [] instead of "". e.g
t1.[Planung GJ+05 mit AZ] AS "Planung GJ+05"
will become
t1.[Planung GJ+05 mit AZ] AS [Planung GJ+05]
Umer Akram
28-Jan-15 4:45am
View
have to tried to execute the generated query on the database to see if any issue? it this query is straight forward, you need to check what value you are passing to PassNo column.
Umer Akram
28-Jan-15 4:40am
View
you have to share your tables structure and with sample of actual data so understand the problem. the solution was as per the provided information. more detail is required.
Umer Akram
28-Jan-15 2:21am
View
That would required some working from your side, 1st you need to share what working you have already done at your end. What is your show stopper in this context.
you can highly improve your solution with a calendar table.
Umer Akram
28-Jan-15 2:01am
View
you are saying that a store which was not a in bigstore table. it value updated and its total quantity is less then 50,000 and still ends up in the bigstore.
that highly unlikely, because that store might be a in bigstore table 1st.
for your understanding check the following example:
USE tempdb
GO
create table instock ( storeid int, QUANTITY int)
create table bigstores ( storeid int)
create table stores ( storeid int)
GO
CREATE TRIGGER TRI_updateINSTOCK
ON instock
FOR update
AS
BEGIN
DECLARE
@storeid smallint,
@totalquantity int
SELECT @storeid= i.storeid FROM inserted i
select @totalquantity = SUM(QUANTITY)
FROM instock
WHERE storeid = @storeid
IF NOT EXISTS(SELECT storeid FROM bigstores WHERE storeid =@storeid )
BEGIN
select @totalquantity
insert into bigstores
select * from stores
where StoreId = @StoreId AND @totalquantity >= 50000
END
END
GO
insert into stores
select 1 union all
select 2 union all
select 3 union all
select 4
insert into instock
select 1, 10000
from stores
---------------------- updated the quantity added to exceed 50,000
update instock
set QUANTITY = QUANTITY + 10000
where storeid = 1
---------------------- updated the quantity drop from 50,000
update instock
set QUANTITY = QUANTITY - 10000
where storeid = 1
GO
drop table instock
drop table bigstores
drop table stores
Umer Akram
28-Jan-15 1:35am
View
Deleted
First of all your IF EXISTS need corrections
<pre lang="SQL">
IF EXISTS ( SELECT Name FROM sysobjects
WHERE Name = 'TRI_deleteINSTOCK' AND Type = 'P' )
DROP trigger TRI_updateINSTOCK
GO
</pre>
it should be
<pre lang="SQL">
IF EXISTS ( SELECT Name FROM sysobjects
WHERE Name = 'TRI_updateINSTOCK' AND Type = 'P' )
DROP trigger TRI_updateINSTOCK
GO
</pre>
Trigger is working fine as defined there might be an understanding issue which is the following:
Let say Store A quantity exceed 50,000. this will be inserted in big store table.
what if someone check the records in the instock table and think the quantity entered is wrong and he/she edit the quantity, doing so the total quantity goes less then 50,000.
now where that store should be a big store or not ?
Umer Akram
27-Jan-15 2:43am
View
what is your desired out ? same share a sample
Umer Akram
27-Jan-15 2:18am
View
can you share some sample data and what's your desired output will be look like? this will help to understand your problem better.
Umer Akram
27-Jan-15 1:53am
View
Well there are many ways to do this. i would suggest you to do it using Microsoft run time library. following is the link
Building Packages Programmatically
Umer Akram
12-Jan-15 1:44am
View
you have to share more details regarding your problem.
Umer Akram
12-Dec-13 7:52am
View
Have give the explicit rights for that user against the view as well.
Umer Akram
12-Dec-13 7:32am
View
you have to 1st convert the datetime variables in to "string" or in SSIS Word "DT-STR" OR "ST_WSTR" by using type casting, after that is very simple you just need to do this
e.g "'Select '" + [@varStartDate] +'"
Hope it helps
Show More