![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I wish to run a preprocessor over script files much as the C preprocessor does for C programs. File inclusion and symbol definition commands are about all I need. Does anyone know of one that will work well with SQL Server script files? |
#3
| |||
| |||
|
|
Gene Wirchenko (genew (AT) ocis (DOT) net) writes: I wish to run a preprocessor over script files much as the C preprocessor does for C programs. File inclusion and symbol definition commands are about all I need. Does anyone know of one that will work well with SQL Server script files? So this is a shameless plug, but you asked for it, didn't you? :-) http://www.sommarskog.se/AbaPerls/index.html will give you everything you need and probably too much you don't need, at least for the moment. |
|
For a more modest effort - and with a more complete preprocessor - get Visual C++ and use that preprocessors. I don't have any samples, but I believe I've heard people who have done it. |
#4
| |||
| |||
|
|
I tried and ran into some trouble. The tests for Win32::SqlServer failed. I got: SQL Server message 2, Severity 16, State 1 Named Pipes Provider: Could not open a connection to SQL Server [2]. Message 08001 from 'Microsoft SQL Server Native Client 10.0', Severity: 16 A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. |
|
My guess is that it is trying to use the wrong instance name. How do I specify the instance? Or is it something else? |
#5
| |||
| |||
|
|
Dear SQLers: I am trying to get around some of the limitations of T-SQL. I wish to run a preprocessor over script files much as the C preprocessor does for C programs. File inclusion and symbol definition commands are about all I need. Does anyone know of one that will work well with SQL Server script files? I want to be able to define symbols like #define ERRSTL N'50001: String %s is too long.' in a secondary file and have statements like raiserror(ERRSTL,16,1,N'ACUK) expand to raiserror(N'50001: String %s is too long.',16,1,N'ACUK) |
#6
| |||
| |||
|
|
If you were running the test suite for Win32::SqlServer, you need to set up connection details with OLLEDBTEST as described in Tests.html. If you are trying to use an AbaPerls tool, use the -S switch to specify a server. |
#7
| |||
| |||
|
|
C:\cbs2dev\SQLServer\AbaPerls\Perl>dbbuild -Server LOOP\SQLEXPRESS -database Banking defined(%hash) is deprecated at c:\cbs2dev\SQLServer\AbaPerls\Perl/AbaPerls/AbaS ql.pm line 433. (Maybe you should just omit the defined()?) Use of uninitialized value $opt_subsystem in uc at dbbuild.bat line 458. |
|
DECLARE @name sysname, Cannot change directory to NAMELESS\sql: No such file or directory |
#8
| ||||
| ||||
|
|
Gene Wirchenko (genew (AT) ocis (DOT) net) writes: C:\cbs2dev\SQLServer\AbaPerls\Perl>dbbuild -Server LOOP\SQLEXPRESS -database Banking defined(%hash) is deprecated at c:\cbs2dev\SQLServer\AbaPerls\Perl/AbaPerls/AbaS ql.pm line 433. (Maybe you should just omit the defined()?) Use of uninitialized value $opt_subsystem in uc at dbbuild.bat line 458. They added more warnings to Perl in 5.12, so you get a lot of these with AbaPerls. I have address these, but I have not made a public |
|
release of those changes yet. And it will probably take some time before I do, since I've recently completed a major overhaul to add support for TFS. I think I want to see it stabilise first... I think Perl 5.10 is a better choice for the time being. |
|
DECLARE @name sysname, Cannot change directory to NAMELESS\sql: No such file or directory |
|
Just a word of warning: if you found Microsoft's documentation difficult to get through, AbaPerls is definitely rougher. Now, I don't know what your current directory is, but let's say you have your SQL files in Banking\SQL in an AbaPerls directory structure. Then you need to be in the folder above Banking and specify -subsy BANKING. |
#9
| |||
| |||
|
|
They added more warnings to Perl in 5.12, so you get a lot of these with AbaPerls. I have address these, but I have not made a public Warnings or errors? By a warning, I mean emit error message and continue. By an error, I mean emit error and stop. |
|
I think Perl 5.10 is a better choice for the time being. Groan! That will be three Perl downloads and installations. I suppose I need the practice. |
|
DECLARE @name sysname, Cannot change directory to NAMELESS\sql: No such file or directory And this? Where is "NAMELESS\sql" coming from? ... No, c:\cbs2dev\SQLServer is the directory name. I have not gotten into organising my SQL Server code into different directories yet. I do not have very much. |
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |