Forum Replies Created

Viewing 15 posts - 6,541 through 6,555 (of 13,460 total)

  • RE: How to automate database scripting

    Dev @ +91 973 913 6683 (10/17/2011)


    via xp_cmdshell;

    Please follow the discussion... I cringe every time I see a recommendation for xp_cmdshell....

    http://www.sqlservercentral.com/Forums/Topic1186236-1526-1.aspx

    oh yeah fully aware of that one...just throwing out...

    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: How to automate database scripting

    Powershell is really good for calling SMO and scripting out the definitions; there's a ton of examples for that.

    There's also some CLR examples as well as TSQL calling SMO via...

    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: how to check the index creation or modified datetime?

    PKs and UQ's constraints can be found in sys.objects;

    so the common fields ofr all objects like create_date and modify_date will get you what you wan:, I think:

    /*--Results

    TableNamecreate_datemodify_datename

    Tally2009-02-27 14:26:36.5772009-02-27 14:26:36.577PK_Tally_N

    Numbers2009-02-27 14:26:41.7172009-02-27...

    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: Inserting into large table in SQL SERVER 2008

    Performace Guard (Shehap) (10/16/2011)


    GilaMonster...Really I wonder from your comments ..!!!!!!

    Please read more about schema partitioning + SQL Alerts+ benefits of each one + Relevant Cases studies

    Gail certainly doesn't need...

    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: Inserting into large table

    your procedure has two output parameters.

    if you don't need the values returned, you could change the code like this:

    declare @p1 bigint

    set @p1=0

    declare @p2 datetime

    set @p2=NULL

    exec MySP @ID=@p1 output,@EntryDateTime=@p2 OUTPUT...

    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: RedGate SQL Refactor

    if you are looking for the reformatting of SQL statements type functionality, I can recommend SQL Pretty Printer For SSMS add-In

    it's only $50 dollars for the registered version. I...

    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: encryption feature for column having data type timestamp

    the OP may be a little loose in the definition of "timestamp" here;

    i'm thinking it's simply a datetime field he's refering to, but I'm with Sean: no need 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: Only integers

    Amy.G (10/14/2011)


    Ah, the CAST vs. CONVERT debate finally gets personal. Well played, Lowell. 😀

    lol, so now it's time for my obligatory reply:

    "CAST?!?! you used CAST?!! you're doing it wrong!" 😀

    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: Inserting with a view

    you'll need to create an INSTEAD OF TRIGGER on the view.

    then the trigger body can use a cosntant, or lookup from another table, or your logic of reusing a passed...

    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: Only integers

    if you convert to say, decimal(5,0) in your calcualtions, would that work for you ?

    /*

    ThePCTFiveOhFiveTwo

    98.9348009998.93

    99.0012009999.00

    99.0441009999.04

    99.0968009999.10

    99.1289009999.13

    99.1865009999.19

    99.2536009999.25

    99.2756009999.28

    99.3197009999.32

    99.3645009999.36

    99.4291009999.43

    */

    With MySampleData

    AS (

    SELECT '98.934800' AS ThePCT UNION ALL

    SELECT '99.001200' UNION ALL

    SELECT '99.044100' UNION ALL

    SELECT '99.096800' UNION...

    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 I trigger an SQL 2000 job or a Stored Procedure via email?

    Freeman-674288 (10/14/2011)


    Sounds like a good option, though I don't see exactly how the web app will be able to validate the GUID I send by email from SQL Server 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: Can I trigger an SQL 2000 job or a Stored Procedure via email?

    how about a different line of attack:

    have the email send a link to a specific web page that requres the specific key (ie a GUID) that comes from the email.

    http://www.yourCompanyWebsite/SecretStuff/Quickfix.aspx?accesskey=C7EC1335-6AD6-49EB-A5CE-B45DF43EF622

    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: Moving a db to different Windows versions

    the structure does not have to match. that's a "nice to have" thing, but not a requirement.

    when you restore, you'll use the WITH MOVE to tell the restore 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: SQL code

    it might be that the second column in the join (being set to a constant) is not correct;

    maybe this?

    SELECT table1.column4,

    table2.column5

    FROM table1

    ...

    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: SQL code

    the (+) syntax was used to show how to do a LEFT OUTER JOIN.

    both Oracle 10+ and SQL can use the newer more understandable syntax like this, so you can...

    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,541 through 6,555 (of 13,460 total)