Sql server

Split string table value function sql server

Split string table value function sql server Function return a table. @String : value with separator ex: 1,2,3@Delimiter : define separator as characterif pass blank string then return one row with null you can set default value. Function with sql server script:Copy the below script execute in database.

Sql server

drop all foreign key constraints in a database

drop all foreign key constraints in a database Using below code you can esaly remove all foreign-key constraints of tables. SELECT ‘IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N”[dbo].’ + FK +”’) AND parent_object_id = OBJECT_ID(N”[dbo].’ + PT + ”’)) ALTER TABLE ‘ + PT + ‘ NOCHECK CONSTRAINT ‘ + FK +Continue Reading “drop all foreign key constraints in a database”

Sql server

Insert Statement Script Generator Procedure

Insert statement generator for database CREATE PROC [dbo].[InsertGenerator] (@tableName varchar(100)) as –Declare a cursor to retrieve column specific information for the specified table DECLARE cursCol CURSOR FAST_FORWARD FOR SELECT column_name,data_type FROM information_schema.columns WHERE table_name = @tableName OPEN cursCol DECLARE @string nvarchar(3000) –for storing the first half of INSERT statement DECLARE @stringData nvarchar(3000) –for storing theContinue Reading “Insert Statement Script Generator Procedure”

Asp.net

Back Button Problem After Logout in ASP.NET

I was facing a problem during one of my project. Actually, I was developing an E-Commerce site, in which I need to give login and logout button. I did login part easily and logout also. But problem arisen, when I pushed back button. Oh! God! Even after logout, it creates a session without login. How?Continue Reading “Back Button Problem After Logout in ASP.NET”

Javascript

Google Map with Multiple Markers

Google Map with Multiple Markers Place the below script in head tag <script type=”text/javascript” src=”http://maps.google.com/maps/api/js?sensor=false”> </script> Place The below Code in body tag <div id=”map” style=”width: 500px; height: 400px;”></div> <script type=”text/javascript”>// <![CDATA[ var locations = [ [‘Bondi Beach’, -33.890542, 151.274856, 4], [‘Coogee Beach’, -33.923036, 151.259052, 5], [‘Cronulla Beach’, -34.028249, 151.157507, 3], [‘Manly Beach’, -33.80010128657071, 151.28747820854187,Continue Reading “Google Map with Multiple Markers”

Sql server

Generate Http post Request From sql server

Generate Http post Request From sql server CREATE procedure HTTP_POST(  @sUrl varchar(200),  @response varchar(8000) out) As Declare @obj int ,@ hr int ,@status int , @msg varchar(255) exec @hr = sp_OACreate ‘MSXML2.ServerXMLHttp’, @obj OUT — exec @hr = sp_OACreate ‘MSXML2.ServerXMLHttp’, @obj OUT if @hr <> 0 begin Raiserror(‘sp_OACreate MSXML2.ServerXMLHttp.3.0 failed’, 16,1) return end exec @hrContinue Reading “Generate Http post Request From sql server”

Asp.net

Using Ajax Call Keep session Alive

Using Ajax Call Keep session Alive Use Below javascript to keep session alive in master page<script type=”text/javascript”> setInterval(‘pingSession()’, 50000); var jqping = jQuery.noConflict(); function pingSession() {       jqping.ajax({ url: ‘Default.aspx’, error: function (){ }, success: function (response) { }, complete: function () { } }); } </script>

Asp.net

Trick To clear Catch Images

Trick To clear Catch Images Easy way to add Query string in a Image Url to generate new request url. so browser not get image from catch. Code: <Asp:Image Id=”img” Runat=”Server”  ImageUrl='<%# String.Format(“{0}?n={1}”,Eval(“ThumbImg”),  System.Guid.NewGuid()) %>

Interview Questions

100 Asp.net Interview Questions and Answers

What is the practical difference between store procedure and function??? Please Explain it in detail technically….??? Store Procedure Function 1)Store Procedure takes input, output parameters. 1)Function only takes input parameter. 2)A store Procedure may return non or more values. 2)A function always return one value either scalar or a table 3)Store Procedure cannot used inContinue Reading “100 Asp.net Interview Questions and Answers”