tag:blogger.com,1999:blog-9075786158122089104.comments2023-10-23T19:47:51.926+05:30SQL-Server Blog of Ritesh Shah --Fight the fear of SQL with SQLHub.comRitesh Shahhttp://www.blogger.com/profile/09562656548324468450noreply@blogger.comBlogger260125tag:blogger.com,1999:blog-9075786158122089104.post-44123313902397923712014-04-19T12:56:49.064+05:302014-04-19T12:56:49.064+05:30Mr. Shah:
I had read your publish in "http://...Mr. Shah:<br />I had read your publish in "http://www.sqlhub.com/2009/08/insert-and-update-image-field-in-sql.html", this a great code, could you give me a tip for the inverse operation, (Create a file from a field in MS_SQL), Thanks in advance.<br />Gregorio Méndez conforma747@hotmail.comAnonymoushttps://www.blogger.com/profile/03525007805594798983noreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-21591831483072203452014-04-10T12:40:17.140+05:302014-04-10T12:40:17.140+05:30Thank you. Its very clean & simple logic.Thank you. Its very clean & simple logic.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-13509210080421812902014-03-11T20:15:59.676+05:302014-03-11T20:15:59.676+05:30SELECT [name], database_id
FROM master.sys.databas...SELECT [name], database_id<br />FROM master.sys.databases WHERE is_cdc_enabled =1 <br /><br />Table_name<br />VODResourcesPackageMap<br />VODResourceDetails<br /><br />EXEC sys.sp_cdc_help_change_data_capture<br /><br />source_schema source_table capture_instance object_id source_object_id start_lsn end_lsn supports_net_changes has_drop_pending role_name index_name filegroup_name create_date index_column_list captured_column_list<br />dbo VODResourceDetails dbo_VODRESOURCEDETAILS 267147997 1205579333 0x0000233F00001F320001 NULL 0 NULL CDC_Role NULL CDC_FileGroup 2014-01-27 15:31:28.267 NULL [ResourceId], [ProviderAssetId], [Type], [HD], [ScreenFormat], [Culture], [Content], [BranchId], [EffectiveDate], [Active]<br />NULL NULL dbo_VODRESOURCEGENRE 347148282 1189579276 0x0000233F00001F320001 NULL 0 NULL CDC_Role NULL CDC_FileGroup 2014-01-27 15:31:28.437 NULL [ReportingInsertDate], [ResourceId], [Genre], [BranchId]<br />dbo VODResourcesPackageMap dbo_VODRESOURCESPACKAGEMAP 427148567 210099789 0x0000233F00001F320001 NULL 0 NULL CDC_Role NULL CDC_FileGroup 2014-01-27 15:31:28.687 NULL [PackageId], [ResourceId], [BranchId], [EffectiveDate], [Active]<br /><br />How do you delete the bad record?Ronhttps://www.blogger.com/profile/06753378066897672164noreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-59487606515870974472013-10-04T01:44:09.919+05:302013-10-04T01:44:09.919+05:30Nice Queries. thanks a lot. It would be nice if yo...Nice Queries. thanks a lot. It would be nice if you can also post some generic queries to release table locks. I am not getting good ones in Google.<br /><br />Thanks<br />Kamal JhunjhunwalaAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-21716351528918105522013-03-22T08:31:01.248+05:302013-03-22T08:31:01.248+05:30Simple and powerfulSimple and powerfulguruhttps://www.blogger.com/profile/02399977406108827331noreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-2442465536579641862013-03-08T01:03:22.594+05:302013-03-08T01:03:22.594+05:30Thank you Ritesh for such a cleanly written articl...Thank you Ritesh for such a cleanly written article. Keep up the good work.srinathhttps://www.blogger.com/profile/01511253630261182435noreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-33439929915165750642013-03-05T19:04:39.795+05:302013-03-05T19:04:39.795+05:30Hello Sir, I"m trying to retrieve image from ...Hello Sir, I"m trying to retrieve image from database and want to show it on Image control in asp.net. But it's getting an error ""<br /><br /> SqlCommand cm = new SqlCommand("select * from asdf where img_id='" + DropDownList1.SelectedItem.ToString() + "'", cn);//image id will be selected.<br /> SqlDataAdapter da = new SqlDataAdapter(cm);<br /> DataSet ds = new DataSet();<br /> da.Fill(ds, "asdf");<br /> SqlDataReader dr = cm.ExecuteReader();<br /> if (dr.Read())<br /> {<br /><br /> string image1 = Convert.ToString(DateTime.Now.ToFileTime());<br /> image1 = "~/E:\\Visual Studio 2010\\WebSites\\WebSite7\\images/" + image1 + ".jpeg";<br />FileStream fs1 = new FileStream(image1, FileMode.CreateNew, FileAccess.Write);<br />byte[] bimage1 = (byte[])ds.Tables[0].Rows[0]["passport_photo"];<br />fs1.Write(bimage1, 0, bimage1.Length);<br />Image1.ImageUrl = "~/E:\\Visual Studio 2010\\WebSites\\WebSite7\\images/";Chiklu.Soumyanoreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-87141201616885642262013-02-21T15:57:05.531+05:302013-02-21T15:57:05.531+05:30How to pass path Dynamically???How to pass path Dynamically???HareKrsnahttps://www.blogger.com/profile/01199024024522537109noreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-66776185852552627172013-01-31T01:48:52.385+05:302013-01-31T01:48:52.385+05:30thank u so much!! you saved my day!thank u so much!! you saved my day!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-51985083463807257422013-01-30T01:54:49.098+05:302013-01-30T01:54:49.098+05:30Worked for meWorked for meAnonymoushttps://www.blogger.com/profile/06731273299234474960noreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-52339736893974647902012-12-28T19:46:14.502+05:302012-12-28T19:46:14.502+05:30EXCELLENT WORK RITESH...NO WORDS TO SAYEXCELLENT WORK RITESH...NO WORDS TO SAYkarthihttps://www.blogger.com/profile/02680081358884623499noreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-24330544988147027952012-12-24T08:19:07.542+05:302012-12-24T08:19:07.542+05:30Here is another way to find second highest salary ...Here is another way to <a href="http://javarevisited.blogspot.dk/2012/12/how-to-find-second-highest-or-maximum-salary-sql.html" rel="nofollow">find second highest salary in MySQL and SQ Server 2008</a>primary keyhttp://java67.blogspot.krnoreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-17862336639042451082012-09-25T15:47:02.842+05:302012-09-25T15:47:02.842+05:30Hi Shilpa,
You have few different way for doing t...Hi Shilpa,<br /><br />You have few different way for doing this. 1.)import/export<br />2.) create customize SSIS package<br />3.) Linked ServerRitesh Shahhttps://www.blogger.com/profile/09562656548324468450noreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-75605740877341161042012-09-25T15:41:01.552+05:302012-09-25T15:41:01.552+05:30Hi,
Can you suggest the steps to transfer tables ...Hi,<br /><br />Can you suggest the steps to transfer tables from 1 database in source server to another database in destination which is in a different server.<br />Server 1(DB1) --> Server2(DB2).<br /><br />Thanks in advanceshilpahttps://www.blogger.com/profile/00302430082048507434noreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-33486248524512012522012-09-25T15:40:40.644+05:302012-09-25T15:40:40.644+05:30Hi,
Can you suggest the steps to transfer tables ...Hi,<br /><br />Can you suggest the steps to transfer tables from 1 database in source server to another database in destination which is in a different server.<br />Server 1(DB1) --> Server2(DB2).<br /><br />Thanks in advanceshilpahttps://www.blogger.com/profile/00302430082048507434noreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-67629462794587873292012-09-25T15:40:09.100+05:302012-09-25T15:40:09.100+05:30Hi Ritesh,
Can you suggest the steps to transfer ...Hi Ritesh,<br /><br />Can you suggest the steps to transfer tables from 1 database in source server to another database in destination which is in a different server.<br />Server 1(DB1) --> Server2(DB2).<br /><br />Thanks in advance<br />shilpahttps://www.blogger.com/profile/00302430082048507434noreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-61268756482976449592012-09-25T15:39:41.836+05:302012-09-25T15:39:41.836+05:30Hi Ritesh,
Can you suggest the steps to transfer ...Hi Ritesh,<br /><br />Can you suggest the steps to transfer tables from 1 database in source server to another database in destination which is in a different server.<br />Server 1(DB1) --> Server2(DB2).<br /><br />Thanks in advance<br />shashwinshilpahttps://www.blogger.com/profile/00302430082048507434noreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-17837047716032241122012-09-25T15:38:07.849+05:302012-09-25T15:38:07.849+05:30Hi Ritesh,
Can you suggest the steps to transfer ...Hi Ritesh,<br /><br />Can you suggest the steps to transfer tables from 1 database in source server to another database in destination which is in a different server.<br />Server 1(DB1) --> Server2(DB2).<br /><br />Thanks in advance<br />shashwinshilpahttps://www.blogger.com/profile/00302430082048507434noreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-42428049943422410232012-09-22T02:33:26.734+05:302012-09-22T02:33:26.734+05:30I have a table named MEAS that contains columns Fi...I have a table named MEAS that contains columns Field1 and Field2. I also have a table named WELD that also contains columns Field1 and Field2. Table WELD has more than one row of data for each value in Field1 and Field2 in Table MEAS. I need to get each value in Field1 and Field2 from Table MEAS and look for it in table WELD to get averages for several fields in Table WELD. I would like to store these averages in a new table. What is the best approach to getting this done?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-85945465983152852632012-08-24T19:48:03.431+05:302012-08-24T19:48:03.431+05:30Here's something I use...
SELECT DATEADD(day,...Here's something I use...<br /><br />SELECT DATEADD(day, (DATEDIFF (day, '2010-01-01', (SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+1,0)))) / 7) * 7, '2010-01-01') AS "LAST_FRIDAY_OF_MONTH"Mikenoreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-70990407928756555582012-08-18T14:16:38.920+05:302012-08-18T14:16:38.920+05:30Good post... Thanks a lot
--URVISH SUTHARGood post... Thanks a lot<br /><br /><br />--URVISH SUTHARAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-90600613285670826202012-08-16T23:58:22.598+05:302012-08-16T23:58:22.598+05:30I tried this method for a txt files, and it worked...I tried this method for a txt files, and it worked great! Thanks Ritesh Shah! You made my day.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-35529120978103746342012-08-12T07:57:39.655+05:302012-08-12T07:57:39.655+05:30Congratulations Ritesh. We are all very proud of y...Congratulations Ritesh. We are all very proud of you!Jacob Sebastianhttps://www.blogger.com/profile/01268709523036565363noreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-2026911200020006032012-08-08T18:38:02.409+05:302012-08-08T18:38:02.409+05:30Thanks a lot.. Satya... :-)
-BihagThanks a lot.. Satya... :-)<br />-BihagAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-33226352437316510962012-08-02T12:51:56.868+05:302012-08-02T12:51:56.868+05:30Many Congratulations!Many Congratulations!Marianoreply@blogger.com