Showing posts with label procedures. Show all posts
Showing posts with label procedures. Show all posts

Friday, March 30, 2012

how to insert the range of ip address in SQL using stored procedures

hi

i need to insert the list of ipaddress using stored procedures.

the user will give the from and to range of IP ADDRESS.i've to insert all the possible ip address between those values.

how to do this..

LEts say the range is from 172.25.50.1 to 172.25.50.30 you can write a WHILE loop to loop through and insert records. There are other ways too but at this time of the night this is the best I can think of without putting any pressure on my brain...

|||

hi dinakar,

thanks for the help @. the late night,

i even wrote a while loop in stored procedure..

what i did is i converted the ips to bigint and made the loop.

now what i need is to place the dots in the corresponding positions from where it was taken out..

can u give any suggestions for this..

|||

i solved it in this way

-- LOOP START

Declare @.testvarchar(40)declare @.s1int,@.s2int,@.s3int,@.s4intset @.s1 =len(145)set @.s2 =len(145)set @.s3 =len(45)set @.s4 =len(45)set @.test ='1451592633'set @.test=substring(@.test,0,@.s1+1)+'.'+substring(@.test,@.s1+1,@.s2)+'.'+substring(@.test,@.s2+@.s1+1,@.s3)+'.'+substring(@.test,@.s1+@.s2+@.s3+1,@.s4)print @.test
-- END OF LOOPsql

Monday, March 12, 2012

How to import data in sql server 2000 from an excel(.xls) file

i want ot import data from excel .xls file to sql server 2000

into an existing table.
should i use some stored procedures or elseYou can use DTS in SQL Server (Right click on the database in Enterprise Manager, then Import) or even attach to the Excel file in Access and then use the upsizing wizard.|||Thnx fo rthe reply i tried this one its fine but i want ot do something more than that
i have a .xls file at my pc and i have to updat ethe database online
for this i know i have to write a web application first
where i put the path of the .xls file but what next how should i write the query which will get the data from .xls file into sql server
please reply asap
regards
softpioneer|||i need to get the xl file in the vb code .Also tell me how to get the hyper link's actual path
i need to get the path of the hyper links too
pls hel asap
regards
softpioneer|||Hi,
Have you got any solution for importing excel data to sql server using vb.net?|||I have seen access imported into SQL via C# and I bet the principles are the same.
Try this link.
http://www.eggheadcafe.com/forums/ForumPost.asp?ID=24776&INTID=6

Friday, February 24, 2012

How to identify most executed queries?

Hi All,
is there a way to identify which are the most executed queries or stored
procedures in a Sql Server 2000? I know that there are some commercial tools
that does it but I don´t want to waste money on it. Any suggestion?
Thanks
Celio.Run a trace and dump and import the trace files into a table and run some
queries.
--
Andrew J. Kelly SQL MVP
"Cmsn Brazil" <Cmsn Brazil@.discussions.microsoft.com> wrote in message
news:4E45B85B-5EE4-41A9-AF3A-C3A1FAC72DE5@.microsoft.com...
> Hi All,
> is there a way to identify which are the most executed queries or stored
> procedures in a Sql Server 2000? I know that there are some commercial
> tools
> that does it but I don´t want to waste money on it. Any suggestion?
> Thanks
> Celio.

How to identify Memory Leak caused by bad written stored procedures?

Does anyone has experience in monitoring Sql server memory leak? I am suspicious of some of the user stored procedures causing the memory leak. Can anyone who has such experience explaine how to find the offened stored procedures?

Thank you very much for any kind of suggestions and recommendations!

Unless you're talking about extended stored procedures, then stored procs themselves don't have memory leaks as such (like normal code), however, they may be doing things inefficiently, or you may have missing table indexes.

The best way to start is to use the SQL Profiler tool to monitor stored procedure execution and look at the duration field. If you capture results to a table, you can then select the slowest queries by ordering on the duration column descending. You should also group by the procedure name to look at the procedures executed most often.

The combination of the slowest queries, and those executed most often will give you the best place to start. From there it's a case of looking at the execution plan (in query analyser) of the procs and looking for ways to optimise the tsql or add/modify indexes.