Forum Replies Created

Viewing 15 posts - 6,196 through 6,210 (of 13,459 total)

  • RE: Convert an interger to year month and days

    the DATEADD function can do this...adding those 366 days to a desired starting date...by default SQL is 1900-01-01, soe something liek this will return the following:

    --returns 1901-01-02 00:00:00.000

    SELECT DATEADD(dd,366,0)--same as...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: quick way to create a table that has every day of the year in it?

    Phil Parkin (12/16/2011)


    Wow.

    Even the requirement of knowing whether or not the moon is gibbous is catered for 🙂

    Adding the moon thing came about with the question "when is the next...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: quick way to create a table that has every day of the year in it?

    here's a copy of mine named TallyCalendar, which generates dates from the SQL beginning of time (1900-0101) to 100 years in the future compared to today.

    the advantage is i've added...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: i need to do a reverse lookup on zip and get city and state for us and canada.

    at least for US data, Here's a copy of one of mine; 42K zip codes, mapped to Cty/County/State;

    CITYDATA_INSERTS.txt

    populating city/county/state if you know the zip is no problem, but

    if you...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: link hanged from asp.net

    durai nagarajan (12/16/2011)


    Hello,

    are you firing a Stored Procedure or query?

    Kindly try the SP or query with the parameter directly on database and check. if the problem is there in DB...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: can a non-serveradmin be enabled to drop a database?

    yep, here's a proof of concepty suite of scripts to test with; worked fine for me:

    create login ClarkKent with password = 'NotARealpassword'

    EXEC master..sp_addsrvrolemember @loginame = N'ClarkKent', @rolename = N'dbcreator'

    EXECUTE AS...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: can a non-serveradmin be enabled to drop a database?

    BOL says the user needs ALTER permission on the database to rename it:

    http://msdn.microsoft.com/en-us/library/ms174269.aspx

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: can a non-serveradmin be enabled to drop a database?

    sqlguy-736318 (12/15/2011)


    A Login with the serveradmin server role is allowed to drop a database. Can a Login with a non-serveradmin role be enabled to drop a database?

    I have a...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Does the Database Mail Task in SSIS use Database Mail?

    i'm pretty sure it's simply using the .NET classes System.Net.Mail.SmtpClient and System.Net.NetworkCredential to send any emails;

    in .NET, it's pretty simple to use that to send an email.

    this is how...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Wondering Reason(s) Records Would Not Be Updated

    does your database have any triggers?

    if the trigger is not well written, it might rollback the action(in this case, a delete, right?) and the data would remain in place...that's the...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: empty sql server database

    here's away that takes foreign keys into consideration; with MsForEachTable, you get errors in deleting due to foreign key violations.

    it also has the ability to add tables you want to...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Find lower case field names

    newbieuser (12/15/2011)


    We are facing some issues on the application with the lower case fields in the database.. So we need to change them all to upper case..

    I would...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Bulk Login Creation Script

    i've seen and create scripts to transfer logins from one server to another ...search for sp_help_revlogin...i believe there are different versions depending on whether you are 2005 vs 2008,...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: First letter upper case for each word in sql server.

    ok i declare mea culpa, now that i see that my post somehow got it's carats stripped out; that's how i found it in my snippets as well. i fixed...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: First letter upper case for each word in sql server.

    i tried switching to LOWER as Brandie identified, and i get a function that never finishes executing...in the meantime, i'll post an older version from my supply of 8 differnet...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 15 posts - 6,196 through 6,210 (of 13,459 total)