Save DAT file in sqlserver

  • Hi,

    i have .DAT file having whole world information.when i am getting information from this file,it takes time.

    I want to save these information in sqlserver and have some indexing etc to increase my performance...My question is Can i save this DAT file in sqlserver?

  • What is the format / structure / contents of this DAT file?

    You can certainly put the raw file into SQL Server and retrieve it again, however that alone will not make it any faster. To gain real benefit, you would have to break-down the structure of your DAT file and re-store it in a relational format.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • @Young:

    i do not know the internal structure(and i do not know how to know/check its internal structure)...i have this file GeoLiteCity.DAT.I am passing IP address of current user and this give me his/her current city and country etc etc.....

    how to increase its speed?

  • Methew (5/20/2012)


    @Young:

    i do not know the internal structure(and i do not know how to know/check its internal structure)...i have this file GeoLiteCity.DAT.I am passing IP address of current user and this give me his/her current city and country etc etc.....

    how to increase its speed?

    google throws up this

    http://www.maxmind.com/app/csv....any good for you?

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • Methew (5/20/2012)


    @Young:

    i do not know the internal structure(and i do not know how to know/check its internal structure)...i have this file GeoLiteCity.DAT.I am passing IP address of current user and this give me his/her current city and country etc etc.....

    how to increase its speed?

    How are you "passing IP address" and to what? You must have some client application that is running on this file, what is it?

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • RBarryYoung (5/20/2012)


    Methew (5/20/2012)


    @Young:

    i do not know the internal structure(and i do not know how to know/check its internal structure)...i have this file GeoLiteCity.DAT.I am passing IP address of current user and this give me his/her current city and country etc etc.....

    how to increase its speed?

    How are you "passing IP address" and to what? You must have some client application that is running on this file, what is it?

    I am using C# ASP.NET..here is my code

    IPSearchLight.GeoLocator loc = new GeoLocator();

    loc.Database_Path_or_URL = "GeoLiteCity.dat";

    string VisitorIP = Request.ServerVariables["REMOTE_ADDR"];

    loc.IP_or_Host = VisitorIP;

    string city = loc.City.ToString();

    string country = loc.Country_Name.ToString();

    where GeoLiteCity.dat is the DAT File having all this data.how i can restructure it so that i can increase performance?

  • formatting your code:

    IPSearchLight.GeoLocator loc = new GeoLocator();

    loc.Database_Path_or_URL = "GeoLiteCity.dat";

    string VisitorIP = Request.ServerVariables["REMOTE_ADDR"];

    loc.IP_or_Host = VisitorIP;

    string city = loc.City.ToString();

    string country = loc.Country_Name.ToString();

    Without the format/structure of your .DAT file there's not much that can be done as the problem is in the GeoLocator code/classes itself. If that tool has some facility for working with a database (Access, SQL Server, MySql) etc., than that might work.

    Also, if it really is a CSV (comma-separated values) file as J Livingston's link seems to indicate, then it certainly could be loaded into almost any database product. To check this, either try to open it in Excel (telling it to use delimited format w Commas), or if it's not too big post it as an attachment here and we can try to look at it.

    The real problem with this approach however, is that the GeoLocator classes are unlikely to work with it, so you will have to write your own code to access the data. But it would be much faster.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • RBarryYoung (5/21/2012)


    formatting your code:

    IPSearchLight.GeoLocator loc = new GeoLocator();

    loc.Database_Path_or_URL = "GeoLiteCity.dat";

    string VisitorIP = Request.ServerVariables["REMOTE_ADDR"];

    loc.IP_or_Host = VisitorIP;

    string city = loc.City.ToString();

    string country = loc.Country_Name.ToString();

    Without the format/structure of your .DAT file there's not much that can be done as the problem is in the GeoLocator code/classes itself. If that tool has some facility for working with a database (Access, SQL Server, MySql) etc., than that might work.

    Also, if it really is a CSV (comma-separated values) file as J Livingston's link seems to indicate, then it certainly could be loaded into almost any database product. To check this, either try to open it in Excel (telling it to use delimited format w Commas), or if it's not too big post it as an attachment here and we can try to look at it.

    The real problem with this approach however, is that the GeoLocator classes are unlikely to work with it, so you will have to write your own code to access the data. But it would be much faster.

    .DAT files can only be opened by the application that created them. There is no indication which application created the file and there is no need to open .DAT files as they merely store data for applications.

    here is the file

    https://skydrive.live.com/?cid=2219579B70FE9DEF&id=2219579B70FE9DEF!117

  • Methew (5/21/2012)


    ...

    .DAT files can only be opened by the application that created them. There is no indication which application created the file and there is no need to open .DAT files as they merely store data for applications.

    here is the file

    https://skydrive.live.com/?cid=2219579B70FE9DEF&id=2219579B70FE9DEF!117%5B/quote%5D

    I can't really figure out what you're getting at here. I did look at the file but it's not a CSV (not on my code page anyway).

    Bottom line: if this GeoLocator service is not fast enough for you, I'd get a different one.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply