how do i get the table structure within the sql server 2000 (the corresponding command within oracle is describe)
Hello Ryan, sorry but this is not what I want. I do get only the number of tables within the database. I want the structure of a table including the attributes, their formats, the primary key and foreign keys.
If you specify a table name as the first argument to sp_help, that is exactly what you get. Have a look at the syntax and comments in BOL.
Does anyone know of a way to get the name of the job that is running. Is there a variable that this is stored in similar to @@servername or a stored procedure that can return this information. I am wanting to capture the jobname while the job is running Randy BuntonOne method is to specify a '[JOBID]' token in your job step T-SQL script. You can then use this value to retrieve the job name from sysjobs. For example. SELECT name FROM msdb..sysjobs WHERE job_id = CAST([JOBID] AS uniqueidentifier) Note that SQL Server Agent job tokens can only be specified in the directly executed script. If you need the value in stored procedures, etc, you can pass the value as a parameter.
SQL Server 2005. Is there a way to obtain the login name of the caller of my user defined function implement in managed C++? I know I can get the information using the code segment below but I want to avoid connecting back to the database for performance reasons. String^ queryString = " ;select suser_sname()" SqlConnection conn = gcnew SqlConnection(connectionString); SqlCommand command
I want to change the name of the data file and corresponding log file. I detach, rename, then try to attach. It recognizes that the name has changed and won't allow me to attach.Sp_attach_db should work. Did you specify all data and log files?
I use this command but it doesnot work cannot cut the size of the log to 2MB DBCC SHRINKFILE(ABC_log,2) what is the correct command actually pls?actually i want to cut the size because it is testing environmenthttp://www.nigelrivett.net/TransactionLogFileGrows_1.html
input, takes the name of a stored procedure, and, as its output, produces a table each of whose rows contains the name and data type of each column in the (presumably unique) result set of that stored procedure? I am trying to build a of the procedure into another table, for comparison with previous or future runs of the same tests. To generate the tables which store the results, I need to know the structure of the procedure's result sets. But, as of now, I cannot think of a way to do this, except for visually inspecting the code of the that_sp'). For the local server to be able to compile the query, it needs to determine the result set of the remote query. The mechanism used today is to issue the command SET FMTONLY ON. This sets a kind of half-exec mode where SQL Server
the server name or the domain of the server which has SQL Server 2000 running. In such a case, will the clients accessing that server face any problems. Any changes to the configuration of the server need to be changed ? TIA, HariChanging Domains shouldn't create to many problems. Changing the name of the machine will cause SQL Server issues. You'll need to use the following if you change the server name sp_dropserver <
exporting SQL Table structure to excel files.( ofcourse not a generate sql script ) It should look as we see in query analyzer with grid output. if u know a way out.. pls do let me know i need to implement auditing for the servers. (not the package to get the details exported every week or so. J.P.JOB files.( ofcourse not a output. implement auditing forThnks it worked this time but needed indexes, primary key and all other constraints on the same table.. what i needed is almost similar kind of report we get in sp_help objectname the complete out put to excel format with grid thnks anyways MayurThnks it worked this time but
to restore the backup to the name the old database had. The Logical Name of the old database did not exactly reflect its name because it was created on the basis of another database (and the logical file names had not been changed because in sqlserver2000 this used to be such a fuss). Now the Logical Name of the on disk. Go and delete or rename them and try again. OR use the MOVE option of the restore command as suggested. The only reference you would have to database file is if the database exists. If it doesn't exist, then no references. But
database, allowing me to select all client names connected to a particular database. But I forgot where I found this (in SQL7). Can someone tell me? Lisasysprocesses table in master database. -- HTH, Vyas, MVP (SQL Server) http://vyaskn.tripod.com/ Is .NET database. But I forgot where I found this (in SQL7). Can someone tell me? LisaThanks, strange enough, under client name, it lists the server name running the sql server rather than the name of the client connecting to it.. this is weird. LisaNote that this can be controlled with