Reputation
1,339
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
5 29 51
Impact
~363k people reached

  • 0 posts edited
  • 0 helpful flags
  • 131 votes cast
Sep
18
comment Creating table with foreign key and index using sqlcmd.exe and batch file
Thanks for your comment. When I wanted to add the actual scripts, I noticed the Index and Foreign keys in the script 002, are referring to another table created later in the batch file. By setting the appropriate order in running them, the issue is resolved.
Dec
12
comment Move values from one table to another one via stored procedure in sql server 2008
I think the best way is using the trigger as described below by Kin, otherwise even if you implement a stored proc, how do you want to call it? Trigger is the best option for this.
Dec
11
comment Uniqueidentifier vs. IDENTITY vs. Material Code --which is the best choice for primary key?
I agree with Joel. Sometimes the natural keys are subject to change or duplication. In these cases, obviously they are not good candidate for primary keys.
Dec
9
comment OpenRowSet - How to configure OLE DB Provider to be used for for distributed queries
I installed it from the link above, reopen the SQL management studio but still this provider is not listed there. Is there anything else should be done to add it to the provider list?
Dec
9
comment OpenRowSet - How to configure OLE DB Provider to be used for for distributed queries
Thanks for your time. I think the reason it's not working for me, is because I don't have 'Microsoft.Ace.OLEDB.12.0' among the providers as you specified in your answer. Could you please advise me how to add it? I've edited my question to include the provider lists I've got currently.
Nov
27
comment Finding rows where a column contains [ and ] characters
Thanks. I used the second option and it worked well.
Nov
25
comment Using OLE DB Source SQL command vs desinging the query using the object tools
Such an insightful answer! I totally agree.
May
17
comment How to add rows/columns to the table in runtime in SSRS 2008
That's what I expected too but the current issue is when there are multiple courses, the original record gets repeated per course. Which is not what we need. Only the Course rows should be added, not the whole student record. I have a row group on StudentId, but it does not help.
May
12
comment Data dictionary best practices in SQL Server 2008 r2
The post you referred me to(above) was a good starting point.Thanks for that.
May
1
comment Image fades on the SSRS report
Thanks Jon. Saving it as png file fixed the issue.
Feb
20
comment How to set the timeoffset in a Datetimeoffset column without changing the date part
Well, I totally agree and understand your point to do it in presentation, but it is a requirement for our scenario, so I should do it in database.
Feb
13
comment Can we minimise the risk of using xp_cmdshell?
I see your point Aaron. You're right.
Feb
12
comment Can we minimise the risk of using xp_cmdshell?
Thanks. It seems what I was looking for. Could you please shed some light on how to do that? Do you mean I should enable xp_cmdshell in the stored proc where it's been called before using and then disable it right after the calling statement (when I'm done with that)?
Feb
12
comment Restore the latest backup on the database
Thanks for your comprehensive reply. I have access to the original server, can it make a difference? I was hoping to be able to do that without having to add a temp table.
Jan
25
comment SQL Server Database Synchronization
Well said Darin! That's it :)
Jan
20
comment sql agent job hangs without any errors or warnings
Sorry, I was typing the comments above from my mobile and made mistakes, which the forum did not let me to delete or edit them after 5 minutes. Do you have call of xp_cmdshell in your job? Is it possible that you are trying to use a resource that is not available at time of running Or the user you have set up to run the job (scheduled) does not have the required rights to access the resource? Also what is the wait type in your ssis package? Is it PREEMPTIVE_OS_PIPEOPS? If so, please check the link below: sqlservercentral.com/Forums/Topic802987-110-1.aspx#bm1339542 The links below al
Jan
20
comment sql agent job hangs without any errors or warnings
Do you call of xp_cmdshell in your job? What is the wait type in your ssis package? The links below might be helpful:
Jan
2
comment Transaction and Try-catch in SQL Server Job
Thanks for your helpful answer and fantastic website! However I'm wondering if still I can use this pattern with a simple DML statement (not a stored proc)? Also do we have to save the transaction as below? (I don't have a store proc to use): save transaction usp_my_procedure_name;
Jan
2
comment Transaction and Try-catch in SQL Server Job
Thanks for your reply, could you please give me a hint how to write it to a log?
Dec
28
comment Calling a SQL Server job within another job
Thanks for your reply. It seems we have to go for Option 2. I'm not quite sure whether I understood it correctly though. Do you mean I should create the scripts for both jobs, and then append steps of job2 to end of job1? Is that right?