How do we get the definition of tables via sql

  • "Give a man a fish and he eats for a day. Teach a man how to fish and he eats for a lifetime."

    I believe Brandie was trying to teach you how to fish. You can learn a lot more by putting some effort into it and researching the system views she pointed out to you, rather than just grabbing some code from a web site. But, if you would rather just eat for a day than a lifetime, that is your choice.

    I'm getting a deja vu feeling... http://www.sqlservercentral.com/Forums/Topic1230310-149-1.aspx

  • mw112009 (2/12/2016)


    Sean:

    As promised I will share it later. Why ? I picked the sp from a website ( just a hour ago ). Before I share it, let me make sure it does the job properly.

    Wait, if you do not know how to do this, and you do not want to try to follow suggestions of others on how to do this, how can you possibly validate that this procedure does what needs to be done?

    Michael L John
    If you assassinate a DBA, would you pull a trigger?
    To properly post on a forum:
    http://www.sqlservercentral.com/articles/61537/

  • Quick and simple suggestion, encapsulate the SMO in a CLR.

    😎

  • ...or use the SMO from within SSIS as this is where he's doing the rest of his scripting.

  • Grumpy DBA (2/12/2016)


    "Give a man a fish and he eats for a day. Teach a man how to fish and he eats for a lifetime."

    I believe Brandie was trying to teach you how to fish. You can learn a lot more by putting some effort into it and researching the system views she pointed out to you, rather than just grabbing some code from a web site. But, if you would rather just eat for a day than a lifetime, that is your choice.

    I'm getting a deja vu feeling... http://www.sqlservercentral.com/Forums/Topic1230310-149-1.aspx%5B/quote%5D

    Same thread, but 4 years ago? Good detective work.

    By the way, the Friday version of your quote:

    "Give a man a fish and he eats for a day. Teach a man how to fish and he drinks beer for a day."

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Grumpy DBA (2/12/2016)


    "Give a man a fish and he eats for a day. Teach a man how to fish and he eats for a lifetime."

    I believe Brandie was trying to teach you how to fish. You can learn a lot more by putting some effort into it and researching the system views she pointed out to you, rather than just grabbing some code from a web site. But, if you would rather just eat for a day than a lifetime, that is your choice.

    I'm getting a deja vu feeling... http://www.sqlservercentral.com/Forums/Topic1230310-149-1.aspx%5B/quote%5D

    Make it easy for others: http://www.sqlservercentral.com/Forums/Topic1230310-149-1.aspx

  • Phil Parkin (2/12/2016)


    Grumpy DBA (2/12/2016)


    "Give a man a fish and he eats for a day. Teach a man how to fish and he eats for a lifetime."

    I believe Brandie was trying to teach you how to fish. You can learn a lot more by putting some effort into it and researching the system views she pointed out to you, rather than just grabbing some code from a web site. But, if you would rather just eat for a day than a lifetime, that is your choice.

    I'm getting a deja vu feeling... http://www.sqlservercentral.com/Forums/Topic1230310-149-1.aspx%5B/quote%5D

    Same thread, but 4 years ago? Good detective work.

    By the way, the Friday version of your quote:

    "Give a man a fish and he eats for a day. Teach a man how to fish and he drinks beer for a day."

    Cheers!

    😎

  • I have similar code I have written myself for use at work. What I wrote was meant to convert VARCHAR columns to NVARCHAR and move the data from old tables to new tables.

  • Wait, if you do not know how to do this, and you do not want to try to follow suggestions of others on how to do this, how can you possibly validate that this procedure does what needs to be done?

    I did not say that I do not know how to do this.( I mean what Brandy suggested.. Plus I have no time for research now ) . What I expected was some code ( Why re-invent the wheel ? )

    I knew this is not something that can be done in a few SQl statements.

    Typically something like this, a person would usually write a sp.

    I was trying to see whether someone can share that sp with me.

    There are enough people around me who will love to give similar answers to what Brandie gave.

    Anyway thank you for your efforts.

  • Eirikur Eiriksson (2/12/2016)


    Phil Parkin (2/12/2016)


    Grumpy DBA (2/12/2016)


    "Give a man a fish and he eats for a day. Teach a man how to fish and he eats for a lifetime."

    I believe Brandie was trying to teach you how to fish. You can learn a lot more by putting some effort into it and researching the system views she pointed out to you, rather than just grabbing some code from a web site. But, if you would rather just eat for a day than a lifetime, that is your choice.

    I'm getting a deja vu feeling... http://www.sqlservercentral.com/Forums/Topic1230310-149-1.aspx%5B/quote%5D

    Same thread, but 4 years ago? Good detective work.

    By the way, the Friday version of your quote:

    "Give a man a fish and he eats for a day. Teach a man how to fish and he drinks beer for a day."

    Cheers!

    😎

    Lynn Phil and Eiriksson

    Agree

    That old article had a URL and that is no longer there ( I mean that page is gone )

    http://www.techrepublic.com/blog/datacenter/script-table-definitions-using-tsql/431/

  • Amazing.

  • mw112009 (2/12/2016)


    Wait, if you do not know how to do this, and you do not want to try to follow suggestions of others on how to do this, how can you possibly validate that this procedure does what needs to be done?

    I did not say that I do not know how to do this.( I mean what Brandy suggested.. Plus I have no time for research now ) . What I expected was some code ( Why re-invent the wheel ? )

    I knew this is not something that can be done in a few SQl statements.

    Typically something like this, a person would usually write a sp.

    I was trying to see whether someone can share that sp with me.

    There are enough people around me who will love to give similar answers to what Brandie gave.

    Anyway thank you for your efforts.

    Why re-invent the wheel? How about making sure you understand how the wheel works since you are the one that will have support it. That's why I didn't go looking on the Internet for the code I needed. I was confident in my understanding of the system tables to develop the code I needed. If I need to tweak it, I already know what the code is doing now so I can easily figure out what needs to be changed or added.

  • Lynn: Let me make this simple.

    I don't have a need to understand how SQL SERVER works. That is not a part of my job. Something like this, Microsoft should have readily provided ( Anyway that is something else )

    I needed help that is why I posted my question

    If a beggar asks for some cash either give him some cash or just ignore or say "no", "Sorry"

    I don't think a beggar will need advice like "Go get a job"

  • mw112009 (2/12/2016)


    Lynn: Let me make this simple.

    I don't have a need to understand how SQL SERVER works. That is not a part of my job. Something like this, Microsoft should have readily provided ( Anyway that is something else )

    I needed help that is why I posted my question

    If a beggar asks for some cash either give him some cash or just ignore or say "no", "Sorry"

    I don't think a beggar will need advice like "Go get a job"

    Actually, MS SQL Server can give you the T-SQL to recreate tables, views, stored procedures, etc. by simply using SQL Server Management Studio.

  • I'm not going to get into the debate of whether or not you want to learn SQL or how SQL Server works because it's not "part of your job" even though you're trying to use it now.

    I'm simply going to say that you should not download code off the internet and run it on your server without understanding how it works. If it goes haywire, you're going to be the one supporting it. You're the one who's going to have to answer questions about why the server was brought to its knees when you ran it. My boss would never accept "I dunno. Somebody on the internet said so" as an excuse for anything. Please, please, please understand code you download before you run it.

Viewing 15 posts - 16 through 30 (of 44 total)

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